lots of cmakelists and component fixes
authorJustin Dickow <jjdickow@gmail.com>
Wed, 9 Jul 2014 18:40:18 +0000 (14:40 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Wed, 9 Jul 2014 18:40:18 +0000 (14:40 -0400)
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
75 files changed:
src/appMain/CMakeLists.txt
src/appMain/life_cycle.h
src/appMain/log4cxx.properties
src/appMain/policy_table.json
src/appMain/smartDeviceLink.ini
src/components/CMakeLists.txt
src/components/HMI/app/StateManager.js
src/components/HMI/app/controller/SettingsController.js
src/components/HMI/app/controller/sdl/Controller.js
src/components/HMI/app/model/sdl/Model.js
src/components/HMI/app/view/sdl/AlertPopUp.js
src/components/HMI/app/view/sdl/PopUp.js
src/components/HMI/app/view/sdl/VRHelpListView.js
src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
src/components/HMI/app/view/sdl/shared/keyboard.js
src/components/HMI/app/view/settings/policiesView.js
src/components/HMI/app/view/settingsView.js
src/components/HMI/css/buttonControls.css
src/components/HMI/css/general.css
src/components/HMI/css/settings.css
src/components/HMI/ffw/BasicCommunicationRPC.js
src/components/HMI/ffw/UIRPC.js
src/components/HMI/index.html
src/components/config_profile/CMakeLists.txt
src/components/config_profile/include/config_profile/profile.h
src/components/config_profile/src/profile.cc
src/components/connection_handler/CMakeLists.txt
src/components/connection_handler/include/connection_handler/connection_handler_impl.h
src/components/connection_handler/src/connection_handler_impl.cc
src/components/dbus/CMakeLists.txt
src/components/formatters/CMakeLists.txt
src/components/hmi_message_handler/CMakeLists.txt
src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h [new file with mode: 0644]
src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
src/components/hmi_message_handler/src/messagebroker_adapter.cc
src/components/hmi_message_handler/src/mqueue_adapter.cc [new file with mode: 0644]
src/components/media_manager/CMakeLists.txt
src/components/media_manager/src/audio/audio_stream_sender_thread.cc
src/components/media_manager/src/socket_streamer_adapter.cc
src/components/protocol_handler/CMakeLists.txt
src/components/qt_hmi/References/Look/.DS_Store [new file with mode: 0644]
src/components/qt_hmi/References/Look/Fonts/HelveticaNeue FinalDeliveryCorrect_13112011.zip [new file with mode: 0644]
src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll [new file with mode: 0644]
src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll [new file with mode: 0644]
src/components/request_watchdog/CMakeLists.txt
src/components/resumption/CMakeLists.txt
src/components/smart_objects/CMakeLists.txt
src/components/utils/CMakeLists.txt
src/components/utils/include/utils/file_system.h
src/components/utils/src/conditional_variable_posix.cc
src/components/utils/src/file_system.cc
src/components/utils/src/threads/posix_thread.cc
test/CMakeLists.txt
test/components/CMakeLists.txt
test/components/application_manager/CMakeLists.txt
test/components/application_manager/rpc/CMakeLists.txt
test/components/connection_handler/CMakeLists.txt
test/components/dbus/CMakeLists.txt
test/components/formatters/CMakeLists.txt
test/components/hmi_message_handler/CMakeLists.txt
test/components/hmi_message_handler/src/test_mqueue_adapter.cc [new file with mode: 0644]
test/components/json_handler/CMakeLists.txt
test/components/media_manager/CMakeLists.txt
test/components/mobile_message_handler/CMakeLists.txt
test/components/protocol_handler/CMakeLists.txt
test/components/request_watchdog/CMakeLists.txt
test/components/smart_objects/CMakeLists.txt
test/components/smart_objects/SchemaItem/CMakeLists.txt
test/components/transport_manager/CMakeLists.txt
test/components/utils/CMakeLists.txt
test/components/utils/include/utils/prioritized_queue_tests.h
test/gtest-example/CMakeLists.txt
test/thirdPartyLibs/jsoncpp/CMakeLists.txt
tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
tools/intergen/utils/include/utils/common_types.h

index d993791..3460e6c 100644 (file)
@@ -1,10 +1,16 @@
-IF (${WEB_HMI})
+IF (HMIADAPTER STREQUAL "messagebroker")
 set (BROKER_LIBRARIES
   MessageBrokerClient
   MessageBrokerServer
 )
-ENDIF (${WEB_HMI})
+ENDIF ()
 
+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(../thirdPartyLibs/libusbx)
+cmake_policy(POP)
 
 if (EXTENDED_MEDIA_MODE)
 set(default_media_inc
@@ -51,12 +57,6 @@ if (BUILD_AVAHI_SUPPORT)
        list(APPEND LIBRARIES avahi-client avahi-common)
 endif()
 if (BUILD_USB_SUPPORT)
-  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(../thirdPartyLibs/libusbx)
-  cmake_policy(POP)
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
   list(APPEND LIBRARIES Libusb-1.0.16)
 endif()
index 91ca0a4..095bc93 100644 (file)
 #define SRC_APPMAIN_LIFE_CYCLE_H_
 
 #include "hmi_message_handler/hmi_message_handler_impl.h"
-#ifdef QT_HMI
+#ifdef DBUS_HMIADAPTER
 #  include "hmi_message_handler/dbus_message_adapter.h"
-#endif  // QT_HMI
-#ifdef WEB_HMI
+#endif  // DBUS_HMIADAPTER
+#ifdef MESSAGEBROKER_HMIADAPTER
 #  include "hmi_message_handler/messagebroker_adapter.h"
-#endif  // WEB_HMI
+#endif  // MESSAGEBROKER_HMIADAPTER
+#ifdef MQUEUE_HMIADAPTER
+#  include "hmi_message_handler/mqueue_adapter.h"
+#endif  // MQUEUE_HMIADAPTER
 #include "application_manager/application_manager_impl.h"
 #include "connection_handler/connection_handler_impl.h"
 #include "protocol_handler/protocol_handler_impl.h"
 #include "media_manager/media_manager_impl.h"
 #include "utils/singleton.h"
 
-#ifdef WEB_HMI
+#ifdef MESSAGEBROKER_HMIADAPTER
 #  include "CMessageBroker.hpp"
 #  include "mb_tcpserver.hpp"
 #  include "networking.h"  // cpplint: Include the directory when naming .h files
-#endif  // WEB_HMI
+#endif  // MESSAGEBROKER_HMIADAPTER
 #include "system.h"      // cpplint: Include the directory when naming .h files
 
 namespace main_namespace {
@@ -77,24 +80,25 @@ class LifeCycle : public utils::Singleton<LifeCycle> {
     connection_handler::ConnectionHandlerImpl* connection_handler_;
     application_manager::ApplicationManagerImpl* app_manager_;
     hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
-#ifdef QT_HMI
+#ifdef DBUS_HMIADAPTER
     hmi_message_handler::DBusMessageAdapter* dbus_adapter_;
-#endif  // QT_HMI
-#ifdef WEB_HMI
+#endif  // DBUS_HMIADAPTER
+#ifdef MESSAGEBROKER_HMIADAPTER
     hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
-#endif  // WEB_HMI
+#endif  // MESSAGEBROKER_HMIADAPTER
+    hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
     media_manager::MediaManagerImpl* media_manager_;
 
-#ifdef WEB_HMI
+#ifdef MESSAGEBROKER_HMIADAPTER
     NsMessageBroker::CMessageBroker* message_broker_;
     NsMessageBroker::TcpServer* message_broker_server_;
     System::Thread* mb_thread_;
     System::Thread* mb_server_thread_;
     System::Thread* mb_adapter_thread_;
-#endif  // WEB_HMI
-#ifdef QT_HMI
+#endif  // MESSAGEBROKER_HMIADAPTER
+#ifdef DBUS_HMIADAPTER
     System::Thread* dbus_adapter_thread_;
-#endif  // QT_HMI
+#endif  // DBUS_HMIADAPTER
 
 #   ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
index 5301ba3..5a3c37c 100644 (file)
@@ -47,7 +47,7 @@ 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
 
 # All SmartDeviceLinkCore logs
-log4j.rootLogger=ALL, SmartDeviceLinkCoreLogFile, SmartDeviceLinkCoreSocketHub
+log4j.rootLogger=ALL, Console, SmartDeviceLinkCoreLogFile, SmartDeviceLinkCoreSocketHub
 
 # TransportManager logs
 log4j.logger.TransportManager=ALL, TransportManagerLogFile
index b047439..33e3240 100644 (file)
-{\r
-       "rpcs":{\r
-               "GetDTCs":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "DiagnosticMessage":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "SystemRequest":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "ReadDID":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-              },\r
-               "AlertManeuver":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "ShowConstantTBT":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "UpdateTurnList":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-            },\r
-                         "UnsubscribeVehicleData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-                       },\r
-                         "SubscribeVehicleData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-                       },\r
-                        "GetVehicleData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-                       },\r
-                       "OnVehicleData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-                       },\r
-                       "GenericResponse":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "DeleteCommand":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "PerformInteraction":{\r
-                  "hmi_levels":[\r
-                     "FULL"\r
-                  ]\r
-               },\r
-               "Speak":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnAppInterfaceUnregistered":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "OnButtonPress":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnEncodedSyncPData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "SetMediaClockTimer":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "AddSubMenu":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "RegisterAppInterface":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "UnregisterAppInterface":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "DeleteSubMenu":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "Alert":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "EncodedSyncPData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "OnButtonEvent":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "DeleteInteractionChoiceSet":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnPermissionsChange":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "SetGlobalProperties":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnCommand":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "Show":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "AddCommand":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "ChangeRegistration":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "CreateInteractionChoiceSet":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "Slider":{\r
-                  "hmi_levels":[\r
-                     "FULL"\r
-                  ]\r
-               },\r
-               "ResetGlobalProperties":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnDriverDistraction":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnHMIStatus":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-               "SubscribeButton":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "UnsubscribeButton":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnTBTClientState":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "OnAudioPassThru":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "PerformAudioPassThru":{\r
-                  "hmi_levels":[\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "EndAudioPassThru":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED"\r
-                  ]\r
-               },\r
-               "ScrollableMessage":{\r
-                  "hmi_levels":[\r
-                     "FULL"\r
-                  ]\r
-               },\r
-               "OnLanguageChange":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-                            "SetDisplayLayout":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                                        "NONE"\r
-                  ]\r
-               },\r
-               "SyncPData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-"DialNumber":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-\r
-"PutFile":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-\r
-"DeleteFile":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-\r
-"ListFiles":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-\r
-"SetAppIcon":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-               },\r
-\r
-\r
-               "OnSyncPData":{\r
-                  "hmi_levels":[\r
-                     "BACKGROUND",\r
-                     "FULL",\r
-                     "LIMITED",\r
-                     "NONE"\r
-                  ]\r
-         }\r
-      }\r
- }\r
+{
+       "rpcs":{
+               "GetDTCs":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "DiagnosticMessage":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "SystemRequest":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "ReadDID":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+              },
+               "AlertManeuver":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "ShowConstantTBT":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "UpdateTurnList":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+            },
+                         "UnsubscribeVehicleData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+                       },
+                         "SubscribeVehicleData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+                       },
+                        "GetVehicleData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+                       },
+                       "OnVehicleData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+                       },
+                       "GenericResponse":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "DeleteCommand":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "PerformInteraction":{
+                  "hmi_levels":[
+                     "FULL"
+                  ]
+               },
+               "Speak":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnAppInterfaceUnregistered":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "OnButtonPress":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnEncodedSyncPData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "SetMediaClockTimer":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "AddSubMenu":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "RegisterAppInterface":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "UnregisterAppInterface":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "DeleteSubMenu":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "Alert":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "EncodedSyncPData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "OnButtonEvent":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "DeleteInteractionChoiceSet":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnPermissionsChange":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "SetGlobalProperties":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnCommand":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "Show":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "AddCommand":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "ChangeRegistration":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "CreateInteractionChoiceSet":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "Slider":{
+                  "hmi_levels":[
+                     "FULL"
+                  ]
+               },
+               "ResetGlobalProperties":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnDriverDistraction":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnHMIStatus":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+               "SubscribeButton":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "UnsubscribeButton":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnTBTClientState":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "OnAudioPassThru":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "PerformAudioPassThru":{
+                  "hmi_levels":[
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "EndAudioPassThru":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED"
+                  ]
+               },
+               "ScrollableMessage":{
+                  "hmi_levels":[
+                     "FULL"
+                  ]
+               },
+               "OnLanguageChange":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+                            "SetDisplayLayout":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                                        "NONE"
+                  ]
+               },
+               "SyncPData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+"DialNumber":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+
+"PutFile":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+
+"DeleteFile":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+
+"ListFiles":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+
+"SetAppIcon":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+               },
+
+
+               "OnSyncPData":{
+                  "hmi_levels":[
+                     "BACKGROUND",
+                     "FULL",
+                     "LIMITED",
+                     "NONE"
+                  ]
+         }
+      }
+ }
index 169db32..f3393a1 100644 (file)
@@ -39,7 +39,7 @@ AppHMILevelNoneRequestsTimeScale = 10
 AppTimeScaleMaxRequests = 100
 AppRequestsTimeScale = 10
 PendingRequestsAmount = 1000
-HeartBeatTimeout = 0
+HeartBeatTimeout = 7
 SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
 SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
 UseLastState = true
@@ -85,3 +85,4 @@ AppInfoStorage = app_info.dat
 [Policy]
 PoliciesTable = policy_table.json
 PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
index 3566e05..4cd4ab5 100644 (file)
@@ -74,9 +74,11 @@ add_subdirectory(./config_profile)
 add_subdirectory(./media_manager)
 
 
-if (${QT_HMI})
+if (${HMI_DBUS_API})
 # --- DBus
     add_subdirectory(./dbus)
+endif ()
+if (${QT_HMI})
 # --- Qt HMI
     add_subdirectory(./qt_hmi)
 endif ()
index 44f1715..7b88578 100644 (file)
@@ -180,6 +180,19 @@ var StateManager = Em.StateManager.extend({
                     this._super();\r
                     SDL.DeviceConfigView.showDeviceList();\r
                 }\r
+            }),\r
+\r
+            appPermissionsList: Em.State.create({\r
+\r
+                enter: function () {\r
+\r
+                    this._super();\r
+\r
+                }\r
+            }),\r
+\r
+            appPermissions: Em.State.create({\r
+\r
             })\r
         })\r
     }),\r
index 9bc83eb..1f78af7 100644 (file)
@@ -114,6 +114,28 @@ SDL.SettingsController = Em.Object.create( {
         }\r
     },\r
 \r
+    changeAppPermission: function(event) {\r
+\r
+        var allowance = SDL.SDLController.getApplicationModel(event.appID).allowedFunctions;\r
+\r
+        for (var i = 0; i < allowance.length; ++i) {\r
+\r
+            if (allowance[i].name == event.name) {\r
+\r
+                if (allowance[i].allowed) {\r
+\r
+                    allowance[i].allowed = false;\r
+                    event.set('text', event.name + " - Not allowed");\r
+                } else {\r
+\r
+                    allowance[i].allowed = true;\r
+                    event.set('text', event.name + " - Allowed");\r
+                }\r
+                break;\r
+            }\r
+        }\r
+    },\r
+\r
     /**\r
      * Method to update array with app permissions which came from SDL\r
      *\r
@@ -158,6 +180,62 @@ SDL.SettingsController = Em.Object.create( {
         }\r
     },\r
 \r
+    /**\r
+     * Method to send request to update array with app permissions\r
+     *\r
+     * @param {Object} element\r
+     *\r
+     */\r
+    GetListOfPermissions: function(element) {\r
+        FFW.BasicCommunication.GetListOfPermissions(element.appID);\r
+    },\r
+\r
+    /**\r
+     * Method to update array with app permissions which came from SDL\r
+     *\r
+     * @param {Object} message\r
+     *\r
+     */\r
+    GetListOfPermissionsResponse: function(message) {\r
+\r
+        if (message.id in SDL.SDLModel.getListOfPermissionsPull) {\r
+\r
+            var appID = SDL.SDLModel.getListOfPermissionsPull[message.id],\r
+                messageCodes = [];\r
+\r
+            SDL.SDLController.getApplicationModel(appID).allowedFunctions = message.result.allowedFunctions;\r
+\r
+            for (var i = 0; i < message.result.allowedFunctions.length; i++) {\r
+                messageCodes.push(message.result.allowedFunctions[i].name);\r
+            }\r
+\r
+            FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.permissionsFriendlyMessageUpdate, appID, messageCodes);\r
+\r
+            SDL.SettingsController.userFriendlyMessagePopUp();\r
+\r
+            SDL.SDLModel.getListOfPermissionsPull.remove(message.id);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Method to update array with app permissions with UserFriendlyMessage from SDL\r
+     *\r
+     * @param {Object} message\r
+     *\r
+     */\r
+    permissionsFriendlyMessageUpdate: function(message, appID) {\r
+            var len = SDL.SDLController.getApplicationModel(appID).allowedFunctions.length;\r
+\r
+            for (var i = 0; i < len; i++) {\r
+\r
+                SDL.SDLController.getApplicationModel(appID).allowedFunctions[i].text = message.label;\r
+            }\r
+\r
+            SDL.AppPermissionsView.update(appID);\r
+\r
+            this.onState('policies.appPermissions');\r
+    },\r
+\r
     updateSDL: function() {\r
         FFW.BasicCommunication.UpdateSDL();\r
     },\r
index 4902698..8c9fb5e 100644 (file)
@@ -48,8 +48,7 @@ SDL.SDLController = Em.Object
             if ( SDL.SliderView.active
                 || SDL.InteractionChoicesView.active
                 || SDL.ScrollableMessage.active
-                || SDL.AudioPassThruPopUp.activate
-                || SDL.VRHelpListView.active) {
+                || SDL.AudioPassThruPopUp.activate) {
 
                 return 'HMI_OBSCURED';
             }
@@ -583,6 +582,11 @@ SDL.SDLController = Em.Object
                     SDL.SDLModel.VRCommands.splice(i, 1);
                 }
             }
+
+            SDL.VRPopUp.DeleteActivateApp(appID);
+            if (SDL.SDLModel.stateLimited == appID) {
+                SDL.SDLModel.set('stateLimited', null);
+            }
             SDL.SDLAppController.set('model', null);
         },
         /**
@@ -609,7 +613,7 @@ SDL.SDLController = Em.Object
                 if (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
                     switch (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
                         case 'SINGLE_KEYPRESS':{
-                            FFW.UI.OnKeyboardInput(str.charAt( str.length-1 ));
+                            FFW.UI.OnKeyboardInput(str.charAt( str.length-1 ), "KEYPRESS");
                             break;
                         }
                         case 'QUEUE_KEYPRESS':{
index 550eeee..23a9bf6 100644 (file)
@@ -910,19 +910,21 @@ SDL.SDLModel = Em.Object.create({
         for (var i in params) {
             if (i === "keyboardProperties") {
                 if (params[i].language) {
-                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.language', params[i].language)
+                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.language', params[i].language);
                 }
                 if (params[i].keyboardLayout) {
                     SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keyboardLayout', params[i].keyboardLayout);
                 }
                 if (params[i].keypressMode) {
-                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keypressMode', params[i].keypressMode)
+                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keypressMode', params[i].keypressMode);
                 }
                 if (params[i].limitedCharacterList) {
-                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', params[i].limitedCharacterList)
+                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', params[i].limitedCharacterList);
+                } else {
+                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', []);
                 }
                 if (params[i].autoCompleteText) {
-                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', params[i].autoCompleteText)
+                    SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', params[i].autoCompleteText);
                 }
             } else {
                 SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.' + i, params[i]);
index de45029..76de5fa 100644 (file)
@@ -61,9 +61,11 @@ SDL.AlertPopUp = Em.ContainerView.create({
      */
     alertRequestId: null,
 
-    content1: 'Title',
+    content1: '',
 
-    content2: 'Text',
+    content2: '',
+
+    content3: '',
 
     active: false,
 
@@ -134,6 +136,10 @@ SDL.AlertPopUp = Em.ContainerView.create({
         this.set('active', false);
         clearTimeout(this.timer);
 
+        this.set('content1', '');
+        this.set('content2', '');
+        this.set('content3', '');
+
         SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId);
 
         SDL.SDLController.onSystemContextChange();
index f71fb62..c877d81 100644 (file)
@@ -67,7 +67,7 @@ SDL.PopUp = Em.ContainerView.create({
         target: 'parentView',
         buttonAction: true,
         onDown: false,
-        disabledBinding: this.buttons
+        disabledBinding: 'parentView.buttons'
     }),
 
     buttonCancel: SDL.Button.extend( {
@@ -77,7 +77,7 @@ SDL.PopUp = Em.ContainerView.create({
         target: 'parentView',
         buttonAction: false,
         onDown: false,
-        disabledBinding: this.buttons
+        disabledBinding: 'parentView.buttons'
     }),
 
     message: SDL.Label.extend({
@@ -95,11 +95,10 @@ SDL.PopUp = Em.ContainerView.create({
     deactivate: function(event) {
         this.set('active', false);
 
-        if (event) {
+        if (this.callback) {
             this.callback(event.buttonAction);
         }
 
-        SDL.SDLController.onSystemContextChange();
 
         this.set('callback', null);
     },
@@ -109,9 +108,9 @@ SDL.PopUp = Em.ContainerView.create({
 
         if (callback) {
             this.set('callback', callback);
-            this.set('buttons', true);
-        } else {
             this.set('buttons', false);
+        } else {
+            this.set('buttons', true);
             setTimeout(function(){
                 SDL.PopUp.deactivate()
             },
@@ -119,6 +118,5 @@ SDL.PopUp = Em.ContainerView.create({
         }
 
         this.set('content', message);
-        SDL.SDLController.onSystemContextChange();
     }
 });
\ No newline at end of file
index 32e156a..4e6dd6e 100644 (file)
@@ -58,7 +58,6 @@ SDL.VRHelpListView = SDL.SDLAbstractView.create( {
         }
 
         SDL.SDLController.VRMove();
-        SDL.SDLController.onSystemContextChange();
     },
 
     /**
@@ -104,6 +103,5 @@ SDL.VRHelpListView = SDL.SDLAbstractView.create( {
         }
 
         this.helpList.list.refresh();
-        SDL.SDLController.onSystemContextChange();
     }
 });
index 64b9384..35499a5 100644 (file)
@@ -68,6 +68,7 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
             SDL.SDLModel.uiShowKeyboard(this);
         },
         search: function(){
+            FFW.UI.OnKeyboardInput(SDL.SDLModel.keyboardInputValue, "ENTRY_SUBMITTED");
             this.get('parentView').deactivate("SUCCESS");
         }
     }),
index 9d71efd..7d8a39a 100644 (file)
@@ -67,6 +67,7 @@ SDL.Keyboard = SDL.SDLAbstractView.create({
         action: function() {
 
             if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.uiPerformInteraction && !SDL.InteractionChoicesView.active) {
+                FFW.UI.OnKeyboardInput("", "ENTRY_CANCELLED");
                 SDL.InteractionChoicesView.deactivate("ABORTED");
             }
             SDL.Keyboard.deactivate();
index 0c0ce1a..2c44751 100644 (file)
  * @version 1.0
  */
 
-SDL.PoliciesView = Em.ContainerView
-    .create( {
+SDL.PoliciesView = Em.ContainerView.create( {
 
-        elementId: 'policies_settings',
+    elementId: 'policies_settings',
 
-        classNames: 'in_settings_view',
+    classNames: 'in_settings_view',
 
-        classNameBindings: [
-            'SDL.States.settings.policies.active:active_state:inactive_state'
-        ],
+    classNameBindings: [
+        'SDL.States.settings.policies.active:active_state:inactive_state'
+    ],
 
-        childViews: [
-            'allowSDLFunctionality',
-            'updateSDLButton',
-            'getStatusUpdate',
-            'getURLS',
-            'statisticsInfo'
-        ],
+    childViews: [
+        'SettingsList'
+    ],
 
-        allowSDLFunctionality: SDL.Button.extend( {
-            goToState: 'policies.deviceConfig',
-            classNames: 'button allowSDLFunctionality settingsButton',
-            text: 'Allow SDL Functionality',
-            elementId: 'allowSDLFunctionality',
-            arrow: true,
-            action: 'onState',
-            target: 'SDL.SettingsController',
-            templateName: 'arrow',
-            onDown: false
-        }),
+    SettingsList: SDL.List.extend( {
 
-        updateSDLButton: SDL.Button.extend( {
-            classNames: 'button updateSDLButton settingsButton',
-            text: 'Update SDL',
-            elementId: 'updateSDLButton',
-            action: 'updateSDL',
-            target: 'SDL.SettingsController',
-            onDown: false
-        }),
+        elementId: 'policies_settings_list',
 
-        getStatusUpdate: SDL.Button.extend( {
-            classNames: 'button getStatusUpdate settingsButton',
-            text: 'Policy table update status',
-            elementId: 'getStatusUpdate',
-            action: 'getStatusUpdate',
-            target: 'SDL.SettingsController',
-            onDown: false
-        }),
+        classNames: 'policies_settings_list',
 
-        getURLS: SDL.Button.extend( {
-            classNames: 'button getURLS settingsButton',
-            text: 'Send request GetURLS',
-            elementId: 'getURLS',
-            action: 'getURLS',
-            target: 'SDL.SettingsController',
-            onDown: false
-        }),
+        itemsOnPage: 5,
 
-        statisticsInfo: SDL.Button.extend( {
-            classNames: 'button statisticsInfo settingsButton',
-            text: 'Statistics Info settings',
-            elementId: 'statisticsInfo',
-            action: 'onState',
-            target: 'SDL.SettingsController',
-            templateName: 'arrow',
-            goToState: 'policies.statisticsInfo',
-            onDown: false
-        })
-    });
\ No newline at end of file
+        /** Items */
+        items: [
+            {
+                type: SDL.Button,
+                params: {
+                    goToState: 'policies.deviceConfig',
+                    text: 'Allow SDL Functionality',
+                    action: 'onState',
+                    target: 'SDL.SettingsController',
+                    templateName: 'arrow',
+                    onDown: false
+                }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'Update SDL',
+                    action: 'updateSDL',
+                    target: 'SDL.SettingsController',
+                    onDown: false
+                }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'Policy table update status',
+                    action: 'getStatusUpdate',
+                    target: 'SDL.SettingsController',
+                    onDown: false
+                }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'Send request GetURLS',
+                    action: 'getURLS',
+                    target: 'SDL.SettingsController',
+                    onDown: false
+                }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'Statistics Info settings',
+                    action: 'onState',
+                    target: 'SDL.SettingsController',
+                    templateName: 'arrow',
+                    goToState: 'policies.statisticsInfo',
+                    onDown: false
+                }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'App permissions',
+                    action: 'onState',
+                    target: 'SDL.SettingsController',
+                    templateName: 'arrow',
+                    goToState: 'policies.appPermissionsList',
+                    onDown: false
+                }
+            }
+        ]
+    })
+});
\ No newline at end of file
index 1a22524..2afb895 100644 (file)
@@ -44,6 +44,8 @@ SDL.SettingsView = Em.ContainerView.create( {
         [
             'leftMenu',
             SDL.PoliciesView,
+            SDL.AppPermissionsListView,
+            SDL.AppPermissionsView,
             SDL.DeviceConfigView,
             SDL.StatisticsInfoView
         ],
index a3c9b94..dae5c32 100644 (file)
 #app_controlButtons .systemRequest {
        top: 252px !important;
        left: 1059px !important;
-       width: 80px !important;
+       width: 135px !important;
        font-size: 16px !important;
     text-align: center;
     line-height: 48px;
index ebc15d2..b1326c5 100644 (file)
@@ -545,6 +545,7 @@ div {
 .inactive_state {
     -webkit-transform: translateX(-2000px);
     -moz-transform: translateX(-2000px);
+    overflow: hidden;
 }
 
 .active_state {
index f7ddb0d..0aff5fe 100644 (file)
     margin-top: 70px;\r
 }\r
 \r
-#settingsView .settingsButton{\r
+#settingsView .policies_settings_list{\r
+    height: 251px;\r
+    width: 598px;\r
+    left: 10px;\r
+}\r
 \r
+#policies_settings_list .list-content .ffw-button{\r
+    width: 537px;\r
+    padding-left: 10px;\r
+}\r
+\r
+#settingsView .settingsButton{\r
     float: left;\r
-    width: 615px;\r
+    width: 536px;\r
     margin-right: 10px;\r
-    height: 51px;\r
+    height: 48px;\r
     font-size: 20px;\r
     line-height: 50px;\r
     border: 1px solid #393939;\r
     cursor: pointer;\r
-    left: 10px;\r
     padding-left: 10px;\r
-}\r
-\r
-#settingsView .updateSDLButton{\r
-    top: 52px;\r
-}\r
-\r
-#settingsView .getStatusUpdate{\r
-    top: 104px;\r
-}\r
-\r
-#settingsView .getURLS{\r
-    top: 156px;\r
-}\r
-\r
-#settingsView .statisticsInfo{\r
-    top: 208px;\r
+    position: relative;\r
 }\r
 \r
 #policies_settings_status_info .listSelect{\r
index 9905a28..5c8c3cb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
+ * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met: Â·
  * Redistributions of source code must retain the above copyright notice, this
@@ -10,7 +10,7 @@
  * with the distribution. Â· Neither the name of the Ford Motor Company nor the
  * names of its contributors may be used to endorse or promote products derived
  * from this software without specific prior written permission.
- *
+ * 
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -45,7 +45,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
 
         onPutFileSubscribeRequestID: -1,
-        allowSDLFunctionalityRequestID: -1,
+allowSDLFunctionalityRequestID: -1,
 
         onSystemErrorSubscribeRequestID: -1,
         onStatusUpdateSubscribeRequestID: -1,
@@ -55,10 +55,10 @@ FFW.BasicCommunication = FFW.RPCObserver
         onAppUnregisteredSubscribeRequestID: -1,
         onPlayToneSubscribeRequestID: -1,
         onSDLCloseSubscribeRequestID: -1,
-        onSDLConsentNeededSubscribeRequestID: -1,
+onSDLConsentNeededSubscribeRequestID: -1,
 
         onPutFileUnsubscribeRequestID: -1,
-        onSystemErrorUnsubscribeRequestID: -1,
+onSystemErrorUnsubscribeRequestID: -1,
         onStatusUpdateUnsubscribeRequestID: -1,
         onAppPermissionChangedUnsubscribeRequestID: -1,
         onFileRemovedUnsubscribeRequestID: -1,
@@ -66,7 +66,7 @@ FFW.BasicCommunication = FFW.RPCObserver
         onAppUnregisteredUnsubscribeRequestID: -1,
         onPlayToneUnsubscribeRequestID: -1,
         onSDLCloseUnsubscribeRequestID: -1,
-        onSDLConsentNeededUnsubscribeRequestID: -1,
+onSDLConsentNeededUnsubscribeRequestID: -1,
 
         // const
         onSystemErrorNotification: "SDL.OnSystemError",
@@ -78,7 +78,7 @@ FFW.BasicCommunication = FFW.RPCObserver
         onAppUnregisteredNotification: "BasicCommunication.OnAppUnregistered",
         onPlayToneNotification: "BasicCommunication.PlayTone",
         onSDLCloseNotification: "BasicCommunication.OnSDLClose",
-        onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
 
         /**
          * init object
@@ -116,7 +116,7 @@ FFW.BasicCommunication = FFW.RPCObserver
             // subscribe to notifications
             this.onPutFileSubscribeRequestID = this.client
                 .subscribeToNotification(this.onPutFileNotification);
-            this.onSystemErrorSubscribeRequestID = this.client
+this.onSystemErrorSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSystemErrorNotification);
             this.onStatusUpdateSubscribeRequestID = this.client
                 .subscribeToNotification(this.onStatusUpdateNotification);
@@ -132,7 +132,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                 .subscribeToNotification(this.onPlayToneNotification);
             this.onSDLCloseSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSDLCloseNotification);
-            this.onSDLConsentNeededSubscribeRequestID = this.client
+this.onSDLConsentNeededSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSDLConsentNeededNotification);
 
         },
@@ -149,7 +149,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
             this.onPutFileUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onPutFileNotification);
-            this.onSystemErrorUnsubscribeRequestID = this.client
+this.onSystemErrorUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSystemErrorNotification);
             this.onStatusUpdateUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onStatusUpdateNotification);
@@ -165,7 +165,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                 .unsubscribeFromNotification(this.onPlayToneUpdatedNotification);
             this.onSDLCloseUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSDLCloseNotification);
-            this.onSDLConsentNeededUnsubscribeRequestID = this.client
+this.onSDLConsentNeededUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSDLConsentNeededNotification);
         },
 
@@ -300,7 +300,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                 SDL.SDLModel.onFileRemoved(notification.params);
             }
 
-            if (notification.method == this.onSystemErrorNotification) {
+if (notification.method == this.onSystemErrorNotification) {
 
                 var message = "Undefined";
 
@@ -342,7 +342,7 @@ FFW.BasicCommunication = FFW.RPCObserver
             if (notification.method == this.onSDLCloseNotification) {
                 //notification handler method
             }
-            if (notification.method == this.onSDLConsentNeededNotification) {
+if (notification.method == this.onSDLConsentNeededNotification) {
 
                 //Show popUp
                 SDL.SettingsController.AllowSDLFunctionality(notification.params.device);
@@ -408,7 +408,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                     SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL(request.params.appID);
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
                 }
-                if (request.method == "BasicCommunication.GetSystemInfo") {
+if (request.method == "BasicCommunication.GetSystemInfo") {
 
                     Em.Logger.log("BasicCommunication.GetSystemInfo Response");
 
@@ -435,7 +435,7 @@ FFW.BasicCommunication = FFW.RPCObserver
                     this.GetURLS(7); //Service type for policies
 
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
-                }
+            }
             }
         },
 
@@ -580,7 +580,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * send response from onRPCRequest
-         *
+         * 
          * @param {Number}
          *            resultCode
          * @param {Number}
@@ -717,7 +717,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * send response from onRPCRequest
-         *
+         * 
          * @param {Number}
          *            id
          * @param {String}
@@ -776,7 +776,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Send request if application was activated
-         *
+         * 
          * @param {number} appID
          */
         OnAppActivated: function(appID) {
@@ -855,7 +855,7 @@ FFW.BasicCommunication = FFW.RPCObserver
         /**
          * Invoked by UI component when user switches to any functionality which
          * is not other mobile application.
-         *
+         * 
          * @params {String}
          * @params {Number}
          */
@@ -895,7 +895,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Used by HMI when User chooses to exit application.
-         *
+         * 
          * @params {Number}
          */
         ExitApplication: function(appID) {
@@ -916,7 +916,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Sent by HMI to SDL to close all registered applications.
-         *
+         * 
          * @params {String}
          */
         ExitAllApplications: function(reason) {
@@ -938,7 +938,7 @@ FFW.BasicCommunication = FFW.RPCObserver
         /**
          * Response with params of the last one supports mixing audio (ie
          * recording TTS command and playing audio).
-         *
+         * 
          * @params {Number}
          */
         MixingAudioSupported: function(attenuatedSupported) {
@@ -962,7 +962,7 @@ FFW.BasicCommunication = FFW.RPCObserver
         /**
          * Response with Results by user/HMI allowing SDL functionality or
          * disallowing access to all mobile apps.
-         *
+         * 
          * @params {Number}
          */
         AllowAllApps: function(allowed) {
@@ -985,7 +985,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Response with result of allowed application
-         *
+         * 
          * @params {Number}
          */
         AllowApp: function(request) {
@@ -1019,7 +1019,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Notifies if device was choosed
-         *
+         * 
          * @param {String}
          *            deviceName
          * @param {Number}
@@ -1045,7 +1045,7 @@ FFW.BasicCommunication = FFW.RPCObserver
 
         /**
          * Send error response from onRPCRequest
-         *
+         * 
          * @param {Number}
          *            resultCode
          * @param {Number}
index 4093d80..143357b 100644 (file)
@@ -1338,7 +1338,7 @@ FFW.UI = FFW.RPCObserver.create({
      * @param {String}
      *
      */
-    OnKeyboardInput: function (value) {
+    OnKeyboardInput: function (value, event) {
 
         Em.Logger.log("FFW.UI.OnKeyboardInput");
 
@@ -1348,7 +1348,7 @@ FFW.UI = FFW.RPCObserver.create({
             "method": "UI.OnKeyboardInput",
             "params": {
                 "data": value,
-                "event": "KEYPRESS"
+                "event": event
             }
         };
         this.client.send(JSONMessage);
index 784ae9c..f28a949 100644 (file)
         <script type="text/javascript" src="app/view/info/nonMediaView.js"></script>\r
 \r
         <!-- settings views -->\r
+\r
+        <script type="text/javascript" src="app/view/settings/policies/appPermissionsListView.js"></script>\r
+        <script type="text/javascript" src="app/view/settings/policies/appPermissionsView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policies/deviceConfigView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policies/statisticsInfoView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policiesView.js"></script>\r
index 72863ee..8df6e96 100644 (file)
@@ -10,7 +10,3 @@ set (SOURCES
 
 add_library("ConfigProfile" ${SOURCES})
 target_link_libraries ("ConfigProfile" Utils)
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libConfigProfile.so DESTINATION lib)
-endif()
index 35cfdce..3a90be2 100644 (file)
@@ -280,6 +280,11 @@ class Profile : public utils::Singleton<Profile> {
      */
     const std::vector<uint32_t>& supported_diag_modes() const;
 
+    /**
+      * @brief Returns system files folder path
+      */
+    const std::string& system_files_path() const;
+
     // Members section
 
   protected:
@@ -403,10 +408,11 @@ class Profile : public utils::Singleton<Profile> {
     std::string                     app_info_storage_;
     int32_t                         heart_beat_timeout_;
     std::string                     preloaded_pt_file_;
-    std::string                     policy_shapshot_file_name_;
+    std::string                     policy_snapshot_file_name_;
     uint32_t                        transport_manager_disconnect_timeout_;
     bool                            use_last_state_;
     std::vector<uint32_t>           supported_diag_modes_;
+    std::string                     system_files_path_;
 
     DISALLOW_COPY_AND_ASSIGN(Profile);
 
index 8b0890b..f6ed0b9 100644 (file)
@@ -42,6 +42,9 @@
 
 namespace {
 const char* kMainSection = "MAIN";
+const char* kPolicySection = "Policy";
+
+const char* kDefaultPoliciesSnapshotFileName = "sdl_snapshot.json";
 // Heartbeat is disabled by default
 const uint32_t kDefaultHeartBeatTimeout = 0;
 }
@@ -80,6 +83,7 @@ Profile::Profile()
       list_files_in_none_(5),
       app_info_storage_("app_info.dat"),
       heart_beat_timeout_(kDefaultHeartBeatTimeout),
+      policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName),
       transport_manager_disconnect_timeout_(0),
       use_last_state_(false),
       supported_diag_modes_(),
@@ -250,6 +254,10 @@ const std::string& Profile::preloaded_pt_file() const {
   return preloaded_pt_file_;
 }
 
+const std::string& Profile::policies_snapshot_file_name() const{
+  return policy_snapshot_file_name_;
+}
+
 uint32_t Profile::transport_manager_disconnect_timeout() const {
   return transport_manager_disconnect_timeout_;
 }
@@ -324,27 +332,33 @@ void Profile::UpdateValues() {
 
   *value = '\0';
   if ((0 != ini_read_value(config_file_name_.c_str(),
-                           "Policy", "PoliciesTable", value))
+                           kPolicySection, "PoliciesTable", value))
       && ('\0' != *value)) {
-    policies_file_name_ = app_config_folder_ + value;
+    policies_file_name_ = app_config_folder_ + '/' + value;
     LOG4CXX_INFO(logger_, "Set policy file to " << policies_file_name_);
   }
 
   *value = '\0';
   if ((0 != ini_read_value(config_file_name_.c_str(),
-                           "Policy", "PreloadedPT", value))
+                           kPolicySection, "PreloadedPT", value))
       && ('\0' != *value)) {
     preloaded_pt_file_ = app_config_folder_ + '/' + value;
     LOG4CXX_INFO(logger_, "Set preloaded policy file to "
                  << preloaded_pt_file_);
   }
 
+  (void) ReadStringValue(&policy_snapshot_file_name_,
+                         kDefaultPoliciesSnapshotFileName,
+                         kPolicySection, "PathToSnapshot");
+  policy_snapshot_file_name_ = app_config_folder_ +
+                               '/' + policy_snapshot_file_name_;
+
   if ((0
       != ini_read_value(config_file_name_.c_str(), "MAIN", "HMICapabilities",
                         value)) && ('\0' != *value)) {
     hmi_capabilities_file_name_ = app_config_folder_ + "/" +  value;
     LOG4CXX_INFO(logger_,
-                 "Set hmi capabilities file to " << hmi_capabilities_file_name_);
+        "Set hmi capabilities file to " << hmi_capabilities_file_name_);
   }
 
   *value = '\0';
index 9d4f964..5689604 100644 (file)
@@ -18,7 +18,3 @@ set(LIBRARIES
 )
 
 add_library("connectionHandler" ${SOURCES})
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libconnectionHandler.so DESTINATION lib)
-endif()
index aef4c45..45f7502 100644 (file)
@@ -248,24 +248,6 @@ class ConnectionHandlerImpl : public ConnectionHandler,
     ConnectionHandlerImpl();
 
     /**
-     * \brief Checks does device exist in list from TransportManager
-     * \param DeviceHandle Handle of device for checking.
-     * \param DeviceHandle Handle of device for checking.
-     * \return True if device exists.
-     */
-    bool DoesDeviceExistInTMList(
-      const std::vector<transport_manager::DeviceInfo>& device_list,
-      const connection_handler::DeviceHandle device_handle);
-
-    /**
-     * \brief Checks does device exist in list and adds if not
-     * \param DeviceHandle Handle of device for checking.
-     * \return True if device was added
-     */
-    bool AddDeviceInDeviceListIfNotExist(
-      const transport_manager::DeviceInfo& device);
-
-    /**
      * \brief Disconnect application.
      *
      * \param device_handle DeviceHandle of disconnected device.
index 1dc3934..7be9d97 100644 (file)
@@ -90,41 +90,6 @@ void ConnectionHandlerImpl::set_connection_handler_observer(
 void ConnectionHandlerImpl::OnDeviceListUpdated(
   const std::vector<transport_manager::DeviceInfo>& device_info_list) {
   LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::OnDeviceListUpdated()");
-
-  bool list_actually_changed = false;
-
-  DeviceListIterator itr = device_list_.begin();
-  while (itr != device_list_.end()) {
-    if (!DoesDeviceExistInTMList(device_info_list, (*itr).first)) {
-      // Device has been removed. Perform all needed actions.
-      // 1. Delete all the connections and sessions of this device
-      // 2. Delete device from a list
-      // 3. Let observer know that device has been deleted.
-      DeviceHandle device_for_remove_handle = (*itr).first;
-      for (ConnectionListIterator it = connection_list_.begin();
-           it != connection_list_.end(); ++it) {
-        if (device_for_remove_handle
-            == (*it).second->connection_device_handle()) {
-          RemoveConnection((*it).first);
-        }
-      }
-      itr = device_list_.erase(itr);
-      list_actually_changed = true;
-      if (connection_handler_observer_) {
-        connection_handler_observer_->RemoveDevice(device_for_remove_handle);
-      }
-    }
-    else {
-      ++itr;
-    }
-  }
-  for (std::vector<transport_manager::DeviceInfo>::const_iterator it_in =
-         device_info_list.begin(); it_in != device_info_list.end(); ++it_in) {
-    list_actually_changed |= AddDeviceInDeviceListIfNotExist((*it_in));
-  }
-  if (connection_handler_observer_ && list_actually_changed) {
-    connection_handler_observer_->OnDeviceListUpdated(device_list_);
-  }
 }
 
 void ConnectionHandlerImpl::OnDeviceFound(
@@ -135,42 +100,34 @@ void ConnectionHandlerImpl::OnDeviceFound(
 void ConnectionHandlerImpl::OnDeviceAdded(
   const transport_manager::DeviceInfo& device_info) {
   LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::OnDeviceAdded()");
+  device_list_.insert(DeviceList::value_type(
+      device_info.device_handle(),
+      Device(device_info.device_handle(), device_info.name(),
+             device_info.mac_address())));
+  if (connection_handler_observer_) {
+    connection_handler_observer_->OnDeviceListUpdated(device_list_);
+  }
 }
 
 void ConnectionHandlerImpl::OnDeviceRemoved(
   const transport_manager::DeviceInfo& device_info) {
   LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::OnDeviceRemoved()");
-}
-
-bool ConnectionHandlerImpl::DoesDeviceExistInTMList(
-  const std::vector<transport_manager::DeviceInfo>& device_list,
-  const connection_handler::DeviceHandle device_handle) {
-  bool result = false;
-  for (std::vector<transport_manager::DeviceInfo>::const_iterator it_in =
-         device_list.begin();
-       it_in != device_list.end();
-       ++it_in) {
-    if (it_in->device_handle() == device_handle) {
-      result = true;
-      break;
+  // Device has been removed. Perform all needed actions.
+  // 1. Delete all the connections and sessions of this device
+  // 2. Delete device from a list
+  // 3. Let observer know that device has been deleted.
+  for (ConnectionListIterator it = connection_list_.begin();
+       it != connection_list_.end(); ++it) {
+    if (device_info.device_handle() ==
+        (*it).second->connection_device_handle()) {
+      RemoveConnection((*it).first);
     }
   }
-  return result;
-}
-
-bool ConnectionHandlerImpl::AddDeviceInDeviceListIfNotExist(
-  const transport_manager::DeviceInfo& device_info) {
-  DeviceListIterator it = device_list_.find(device_info.device_handle());
-  if (device_list_.end() == it) {
-    LOG4CXX_INFO(logger_, "Adding new device!");
-    device_list_.insert(
-      DeviceList::value_type(
-        device_info.device_handle(),
-        Device(device_info.device_handle(), device_info.name(),
-               device_info.mac_address())));
-    return true;
+  device_list_.erase(device_info.device_handle());
+  if (connection_handler_observer_) {
+    connection_handler_observer_->RemoveDevice(device_info.device_handle());
+    connection_handler_observer_->OnDeviceListUpdated(device_list_);
   }
-  return false;
 }
 
 void ConnectionHandlerImpl::OnScanDevicesFinished() {
index 48bd05e..d9320c8 100644 (file)
@@ -41,7 +41,3 @@ add_custom_command(
 
 add_library("DBus" ${SOURCES})
 target_link_libraries("DBus" "${LIBRARIES}")
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libDBus.so DESTINATION lib)
-endif()
index 102f005..31016ee 100644 (file)
@@ -23,7 +23,3 @@ set (FORMATTER_SOURCES
 add_library("formatters" ${SOURCES}
         ${FORMATTER_SOURCES}
 )
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libformatters.so DESTINATION lib)
-endif()
index 5432ab1..186b0c9 100644 (file)
@@ -16,28 +16,24 @@ include_directories (
   ${CMAKE_SOURCE_DIR}/
 )
 
-IF (${QT_HMI})
+IF (HMIADAPTER STREQUAL "dbus")
     set (DBUS_SOURCE ./src/dbus_message_adapter.cc)
     set (DBUS_ADAPTER DBus)
-    set (MESSAGE_BROKER MessageBrokerClient MessageBrokerServer)
-ENDIF (${QT_HMI})
+ENDIF ()
 
 set (SOURCES
     ./src/hmi_message_handler_impl.cc
     ./src/messagebroker_adapter.cc
     ./src/hmi_message_adapter.cc
+    ./src/mqueue_adapter.cc
     ${DBUS_SOURCE}
 )
 
 set (LIBRARIES
+    Utils
     log4cxx
     ${DBUS_ADAPTER}
-    ${MESSAGE_BROKER}
 )
 
 add_library("HMIMessageHandler" ${SOURCES})
 target_link_libraries ("HMIMessageHandler" ${LIBRARIES})
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libHMIMessageHandler.so DESTINATION lib)
-endif()
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
new file mode 100644 (file)
index 0000000..b0fb016
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
+
+#include <memory>
+#include <mqueue.h>
+#include "utils/threads/thread.h"
+#include "hmi_message_handler/hmi_message_adapter.h"
+
+namespace hmi_message_handler {
+
+/**
+ * \brief HMI message adapter for mqueue
+ */
+class MqueueAdapter : public HMIMessageAdapter {
+ public:
+  MqueueAdapter(HMIMessageHandler* hmi_message_handler);
+  virtual ~MqueueAdapter();
+
+ protected:
+  virtual void SendMessageToHMI(MessageSharedPointer message);
+  virtual void SubscribeTo();
+
+ private:
+  mqd_t sdl_to_hmi_mqueue_;
+  mqd_t hmi_to_sdl_mqueue_;
+  std::auto_ptr<threads::Thread> receiver_thread_;
+};
+
+}  // namespace hmi_message_handler
+
+#endif  // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
index 48dcbf7..2062b21 100644 (file)
@@ -95,8 +95,9 @@ void HMIMessageHandlerImpl::AddHMIMessageAdapter(HMIMessageAdapter* adapter) {
 void HMIMessageHandlerImpl::RemoveHMIMessageAdapter(
     HMIMessageAdapter* adapter) {
   LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::RemoveHMIMessageAdapter()");
-  DCHECK(adapter != NULL);
-  message_adapters_.erase(adapter);
+  if (adapter != NULL) {
+    message_adapters_.erase(adapter);
+  }
 }
 
 void HMIMessageHandlerImpl::Handle(const impl::MessageFromHmi& message) {
index 5b395ef..841ee15 100644 (file)
@@ -127,6 +127,8 @@ void MessageBrokerAdapter::SubscribeTo() {
   MessageBrokerController::subscribeTo("BasicCommunication.OnSystemInfoChanged");
   MessageBrokerController::subscribeTo("SDL.OnAppPermissionConsent");
   MessageBrokerController::subscribeTo("SDL.OnAllowSDLFunctionality");
+  MessageBrokerController::subscribeTo("SDL.OnSystemError");
+  MessageBrokerController::subscribeTo("SDL.AddStatisticsInfo");
 
   LOG4CXX_INFO(logger_, "Subscribed to notifications.");
 }
diff --git a/src/components/hmi_message_handler/src/mqueue_adapter.cc b/src/components/hmi_message_handler/src/mqueue_adapter.cc
new file mode 100644 (file)
index 0000000..d57ebfa
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi_message_handler/mqueue_adapter.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace hmi_message_handler {
+
+const int kMqueueSize = 100;
+const int kMqueueMessageSize = 65536;
+const char* kSdlToHmiQueue = "/sdl_to_hmi";
+const char* kHmiToSdlQueue = "/hmi_to_sdl";
+
+log4cxx::LoggerPtr logger =
+    log4cxx::LoggerPtr(log4cxx::Logger::getLogger("HMIMessageHandler"));
+
+class ReceiverThreadDelegate : public threads::ThreadDelegate {
+ public:
+  ReceiverThreadDelegate(mqd_t mqueue_descriptor,
+                         HMIMessageHandler* hmi_message_handler)
+      : mqueue_descriptor_(mqueue_descriptor),
+        hmi_message_handler_(hmi_message_handler) {}
+
+ private:
+  virtual void threadMain() {
+    while (true) {
+      static char buffer[kMqueueMessageSize];
+      const ssize_t size =
+          mq_receive(mqueue_descriptor_, buffer, kMqueueMessageSize, NULL);
+      if (-1 == size) {
+        LOG4CXX_ERROR(logger, "Message queue receive failed, error " << errno);
+        continue;
+      }
+      const std::string message_string(buffer, buffer + size);
+      LOG4CXX_INFO(logger, "Message: " << message_string);
+      MessageSharedPointer message(new application_manager::Message(
+          protocol_handler::MessagePriority::kDefault));
+      message->set_json_message(message_string);
+      message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+      hmi_message_handler_->OnMessageReceived(message);
+    }
+  }
+
+  const mqd_t mqueue_descriptor_;
+  HMIMessageHandler* hmi_message_handler_;
+};
+
+MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler)
+    : HMIMessageAdapter(hmi_message_handler),
+      sdl_to_hmi_mqueue_(-1),
+      hmi_to_sdl_mqueue_(-1),
+      receiver_thread_() {
+  mq_attr mq_attributes;
+  mq_attributes.mq_maxmsg = kMqueueSize;
+  mq_attributes.mq_msgsize = kMqueueMessageSize;
+  sdl_to_hmi_mqueue_ =
+      mq_open(kSdlToHmiQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
+  if (-1 == sdl_to_hmi_mqueue_) {
+    LOG4CXX_ERROR(logger, "Could not open message queue "
+                              << kSdlToHmiQueue << ", error " << errno);
+    return;
+  }
+  hmi_to_sdl_mqueue_ =
+      mq_open(kHmiToSdlQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
+  if (-1 == hmi_to_sdl_mqueue_) {
+    LOG4CXX_ERROR(logger, "Could not open message queue "
+                              << kHmiToSdlQueue << ", error " << errno);
+    return;
+  }
+  ReceiverThreadDelegate* receiver_thread_delegate =
+      new ReceiverThreadDelegate(hmi_to_sdl_mqueue_, hmi_message_handler);
+  receiver_thread_.reset(
+      new threads::Thread("mqueue receiver", receiver_thread_delegate));
+  receiver_thread_->start();
+}
+
+MqueueAdapter::~MqueueAdapter() {
+  if (receiver_thread_.get()) receiver_thread_->stop();
+  if (-1 != hmi_to_sdl_mqueue_) mq_close(hmi_to_sdl_mqueue_);
+  if (-1 != sdl_to_hmi_mqueue_) mq_close(sdl_to_hmi_mqueue_);
+  mq_unlink(kHmiToSdlQueue);
+  mq_unlink(kSdlToHmiQueue);
+}
+
+void MqueueAdapter::SendMessageToHMI(const MessageSharedPointer message) {
+  LOG4CXX_TRACE_ENTER(logger);
+
+  if (-1 == sdl_to_hmi_mqueue_) {
+    LOG4CXX_ERROR(logger, "Message queue is not opened");
+    return;
+  }
+  const std::string& json = message->json_message();
+  if (json.size() > kMqueueMessageSize) {
+    LOG4CXX_ERROR(logger, "Message size " << json.size() << " is too big");
+    return;
+  }
+  const int rc = mq_send(sdl_to_hmi_mqueue_, json.c_str(), json.size(), 0);
+  if (0 != rc) {
+    LOG4CXX_ERROR(logger, "Could not send message, error " << errno);
+    return;
+  }
+
+  LOG4CXX_TRACE_EXIT(logger);
+}
+
+void MqueueAdapter::SubscribeTo() {
+  // empty implementation of pure virtual method, actually it's not called
+}
+
+}  // namespace hmi_message_handler
index d7beed6..9365019 100644 (file)
@@ -61,6 +61,7 @@ include_directories (
   ../../thirdPartyLibs/jsoncpp/include/
   ${CMAKE_BINARY_DIR}/src/components/
   ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/include/
+  ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
   ${default_includes}
 )
 
index 2a91845..46dcd65 100644 (file)
@@ -38,7 +38,6 @@
 
 
 #include <string>
-#include <unistd.h>
 #include "application_manager/application_manager_impl.h"
 #include "application_manager/mobile_command_factory.h"
 #include "application_manager/application_impl.h"
@@ -125,7 +124,7 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() {
                                      std::vector<uint8_t>(from, to));
     binaryData.clear();
   }
-#if !defined(EXTENDED_MEDIA)
+#if !defined(EXTENDED_MEDIA_MODE)
   // without recording stream restart reading 1-sec file
   offset_ = 0;
 #endif
index ed4a7cf..914b184 100644 (file)
@@ -305,22 +305,15 @@ bool SocketStreamerAdapter::Streamer::send(
                   "Server: SDL\r\n"
                   "Content-Type: video/mp4\r\n\r\n"
                  };
-#ifdef OS_MACOSX
-    if (-1 == ::send(new_socket_fd_, hdr, strlen(hdr), SO_NOSIGPIPE)) {
-#else
+
     if (-1 == ::send(new_socket_fd_, hdr, strlen(hdr), MSG_NOSIGNAL)) {
-#endif
       LOG4CXX_ERROR_EXT(logger, " Unable to send");
       return false;
     }
   }
-#ifdef OS_MACOSX
-  if (-1 == ::send(new_socket_fd_, (*msg).data(),
-                   (*msg).data_size(), SO_NOSIGPIPE)) {
-#else
+
   if (-1 == ::send(new_socket_fd_, (*msg).data(),
                    (*msg).data_size(), MSG_NOSIGNAL)) {
-#endif
     LOG4CXX_ERROR_EXT(logger, " Unable to send");
     return false;
   }
index c60774d..2ca4de0 100644 (file)
@@ -18,7 +18,3 @@ set (SOURCES
 )
 
 add_library("ProtocolHandler" ${SOURCES})
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libProtocolHandler.so DESTINATION lib)
-endif()
diff --git a/src/components/qt_hmi/References/Look/.DS_Store b/src/components/qt_hmi/References/Look/.DS_Store
new file mode 100644 (file)
index 0000000..c84f3ca
Binary files /dev/null and b/src/components/qt_hmi/References/Look/.DS_Store differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeue FinalDeliveryCorrect_13112011.zip b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeue FinalDeliveryCorrect_13112011.zip
new file mode 100644 (file)
index 0000000..3cc1352
Binary files /dev/null and b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeue FinalDeliveryCorrect_13112011.zip differ
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
new file mode 100644 (file)
index 0000000..52506bb
Binary files /dev/null and b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll 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
new file mode 100644 (file)
index 0000000..4d811be
Binary files /dev/null and b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll differ
index ad9c3da..fe88560 100644 (file)
@@ -13,7 +13,3 @@ set (SOURCES
 
 add_library("RequestWatchdog" ${SOURCES})
 target_link_libraries ("RequestWatchdog" Utils)
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libRequestWatchdog.so DESTINATION lib)
-endif()
index 93752a9..390d149 100644 (file)
@@ -10,7 +10,3 @@ set (SOURCES
 )
 
 add_library("Resumption" ${SOURCES})
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libResumption.so DESTINATION lib)
-endif()
index b1c58f9..02d4797 100644 (file)
@@ -20,7 +20,3 @@ set (SOURCES
 
 add_library("SmartObjects" ${SOURCES})
 target_link_libraries ("SmartObjects" log4cxx)
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libSmartObjects.so DESTINATION lib)
-endif()
index e06d300..e03a355 100644 (file)
@@ -33,12 +33,6 @@ add_library("Utils" ${SOURCES})
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
        target_link_libraries ("Utils" log4cxx apr-1 aprutil-1)
-ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+else()
        target_link_libraries ("Utils" log4cxx apr-1 aprutil-1 rt)
-ELSE()
-  target_link_libraries ("Utils" log4cxx apr-1 aprutil-1)
-endif()
-
-if( BUILD_SHARED_LIBS )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libUtils.so DESTINATION lib)
 endif()
index fb55b97..49441ec 100644 (file)
@@ -74,6 +74,13 @@ uint32_t FileSize(const std::string& path);
 std::string CreateDirectory(const std::string& name);
 
 /**
+ * @brief Creates directory recursively
+ * @param path - full path to directory
+ * @return return true if directory was created or already exist
+ */
+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.
index c11b063..46b31ee 100644 (file)
@@ -54,9 +54,7 @@ ConditionalVariable::ConditionalVariable() {
   if (initialized != 0)
     LOG4CXX_ERROR(g_logger, "Failed to initialize "
                             "conditional variable attributes");
-#ifdef __linux__
-  pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC); // Default (non linux) will use the CPU clock
-#endif
+  pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC);
   initialized = pthread_cond_init(&cond_var_, &attrs);
   if (initialized != 0)
     LOG4CXX_ERROR(g_logger, "Failed to initialize "
@@ -96,28 +94,10 @@ void ConditionalVariable::Wait(AutoLock& auto_lock) {
     LOG4CXX_ERROR(g_logger, "Failed to wait for conditional variable");
 }
 
-#ifdef OS_LINUX
-static void current_time(struct timespec *ts) {
-  clock_gettime(CLOCK_MONOTONIC, ts);
-}
-#elif OS_MACOSX
-#include <mach/clock.h>
-#include <mach/mach.h>
-static void current_time(struct timespec *ts) {
-  clock_serv_t cclock;
-  mach_timespec_t mts;
-  host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
-  clock_get_time(cclock, &mts);
-  mach_port_deallocate(mach_task_self(), cclock);
-  ts->tv_sec = mts.tv_sec;
-  ts->tv_nsec = mts.tv_nsec;
-}
-#endif
-
 ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
     AutoLock& auto_lock, int32_t milliseconds){
   struct timespec now;
-  current_time(&now);
+  clock_gettime(CLOCK_MONOTONIC, &now);
   timespec wait_interval;
   wait_interval.tv_sec = now.tv_sec +
       (milliseconds / kMillisecondsPerSecond);
index b0cc8ba..4648f8c 100644 (file)
@@ -113,6 +113,22 @@ std::string file_system::CreateDirectory(const std::string& name) {
   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;
+}
+
 bool file_system::IsDirectory(const std::string& name) {
   struct stat status;
   memset(&status, 0, sizeof(status));
index bc43d4a..3bbdec8 100644 (file)
@@ -131,11 +131,7 @@ bool Thread::startWithOptions(const ThreadOptions& options) {
   success = !pthread_create(&thread_handle_, &attributes, threadFunc,
                             delegate_);
   if (success) {
-#ifdef __linux__
     pthread_result = pthread_setname_np(thread_handle_, name_.c_str());
-#elif OS_MACOSX
-    pthread_result = pthread_setname_np(name_.c_str());
-#endif
 #   ifdef __QNXNTO__
     if (pthread_result != EOK) {
       LOG4CXX_INFO(logger_,"Couldn't set pthread name"
index 3d51830..1a5b0ac 100644 (file)
@@ -9,7 +9,7 @@ find_package(LibXML2 REQUIRED)
 add_subdirectory(./components)
 add_subdirectory(./thirdPartyLibs)
 add_subdirectory(${CMAKE_SOURCE_DIR}/src/components/policy/test/policy ./policy)
-#add_subdirectory(./tools)
+add_subdirectory(./tools)
 
 
 include_directories (
index 8e65bea..8ce3113 100644 (file)
@@ -20,6 +20,8 @@ add_subdirectory(./protocol_handler)
 # --- ProtocolHandler
 add_subdirectory(./connection_handler)
 
+add_subdirectory(./hmi_message_handler)
+
 # --- Utils
 add_subdirectory(./utils)
 
index e50bb7f..d8334d1 100644 (file)
@@ -9,8 +9,8 @@ endif()
 ###############################################################################
 
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/application_manager/include
   ../../../src/components/smart_objects/include
   ../../../src/components/formatters/include/
@@ -30,6 +30,8 @@ set(LIBRARIES
     MOBILE_API
     HMI_API
     SmartObjects
+    apr-1
+    aprutil-1
 )
 
 #create_test("test_APIVersionConverterV1Test" "./api_converter_v1_test.cpp" "${LIBRARIES}")
index 59e862e..e7f3a35 100644 (file)
@@ -9,8 +9,8 @@ add_definitions(${GLIB2_CFLAGS})
 
 include_directories (
   ./include
-  ../../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../../src/thirdPartyLibs/MessageBroker/include
   ../../../../src/thirdPartyLibs/jsoncpp/include
   ../../../../src/appMain
index c8db94f..dcffa5e 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/transport_manager/include
   ../../../src/components/utils/include
   ../../../src/components/protocol_handler/include
@@ -17,7 +17,6 @@ set (LIBRARIES
     connectionHandler
     TransportManager
     Utils
-    bluetooth    
 )
 
 set (SOURCES
index 2a7e7cb..0f4a31d 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/include
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ${CMAKE_SOURCE_DIR}/src/components/
   ${CMAKE_BINARY_DIR}/src/components/
   ${CMAKE_SOURCE_DIR}/src/components/dbus/include/
index 4517753..47d6af5 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/smart_objects/include
   ../../../src/components/formatters/include
   ../../../src/components/utils/include
index 1ccd388..1a558f4 100644 (file)
@@ -1,10 +1,12 @@
 include_directories (
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/include
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/jsoncpp/include/
   ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/logger/include/
   ${CMAKE_SOURCE_DIR}/src/components/utils/include/
+  ${CMAKE_SOURCE_DIR}/src/components/application_manager/include/
   ${CMAKE_SOURCE_DIR}/src/components/hmi_message_handler/include/
+  ${CMAKE_SOURCE_DIR}/src/components/protocol_handler/include/
   ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
   ${CMAKE_SOURCE_DIR}/test/components/hmi_message_handler/include/
   ${CMAKE_BINARY_DIR}/src/components/
@@ -16,6 +18,9 @@ set (LIBRARIES
     gmock
     gmock_main
     Utils
+    ProtocolHandler
+    ApplicationManager
+    SmartObjects
     jsoncpp
     HMIMessageHandler
 )
@@ -25,4 +30,6 @@ set (SOURCES
    #./src/test_dbus_message_adapter.cc
 )
 
-#create_test("test_DBusMessageAdapter" "${SOURCES}" "${LIBRARIES}")
\ No newline at end of file
+#create_test("test_DBusMessageAdapter" "${SOURCES}" "${LIBRARIES}")
+create_test("test_mqueue_adapter" "./src/test_mqueue_adapter.cc" "${LIBRARIES}")
+
diff --git a/test/components/hmi_message_handler/src/test_mqueue_adapter.cc b/test/components/hmi_message_handler/src/test_mqueue_adapter.cc
new file mode 100644 (file)
index 0000000..c30b3aa
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
+
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "hmi_message_handler/mqueue_adapter.h"
+
+using hmi_message_handler::MessageSharedPointer;
+using hmi_message_handler::HMIMessageHandler;
+using hmi_message_handler::HMIMessageAdapter;
+using hmi_message_handler::MqueueAdapter;
+using application_manager::Message;
+
+class MockHandler : public HMIMessageHandler {
+ public:
+  MOCK_METHOD1(OnMessageReceived, void(MessageSharedPointer message));
+  virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) {}
+  virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) {}
+  virtual void OnErrorSending(MessageSharedPointer message) {}
+  virtual void SendMessageToHMI(MessageSharedPointer message) {}
+};
+
+TEST(MqueueAdapter, Send) {
+  MockHandler handler;
+  HMIMessageAdapter* adapter = new MqueueAdapter(&handler);
+
+  MessageSharedPointer message(
+      new Message(protocol_handler::MessagePriority::kDefault));
+  message->set_json_message("{}");
+  adapter->SendMessageToHMI(message);
+
+  mqd_t mqd = mq_open("/sdl_to_hmi", O_RDONLY);
+  ASSERT_NE(-1, mqd);
+  static char buf[65536];
+  ssize_t sz = mq_receive(mqd, buf, 65536, NULL);
+  ASSERT_EQ(2, sz);
+  EXPECT_STREQ("{}", buf);
+
+  delete adapter;
+}
+
+TEST(MqueueAdapter, Receive) {
+  MockHandler handler;
+  HMIMessageAdapter* adapter = new MqueueAdapter(&handler);
+
+  using ::testing::Property;
+  using ::testing::Pointee;
+  EXPECT_CALL(
+      handler,
+      OnMessageReceived(Property(
+          &MessageSharedPointer::get,
+          Pointee(Property(&Message::json_message, std::string("()"))))));
+
+  mqd_t mqd = mq_open("/hmi_to_sdl", O_WRONLY);
+  ASSERT_NE(-1, mqd);
+  const char buf[] = "()";
+  int rc = mq_send(mqd, buf, sizeof(buf) - 1, 0);
+  ASSERT_EQ(0, rc);
+
+  delete adapter;
+}
index ae069a0..ef28e8c 100644 (file)
@@ -6,8 +6,8 @@ GenerateInterface("test_JSONHandler_v4_protocol_v1_2_no_extra.xml" "Gen::test::c
 
 include_directories (
   ${CMAKE_SOURCE_DIR}/src//thirdPartyLibs/jsoncpp/include/
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/include
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/gtest/include
 
   ${CMAKE_SOURCE_DIR}/src/components/utils/include
   ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include
index df51801..61b12a2 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/media_manager/include
   ../../../src/components/utils/include/
   ../../../src/components/protocol_handler/include/
index 23f480e..d5b8e16 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/application_manager/include
   ../../../src/components/protocol_handler/include
   ../../../src/components/mobile_message_handler/include/
index 0756d51..ed4ca50 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/transport_manager/include
   ../../../src/components/utils/include
   ../../../src/components/protocol_handler/include
@@ -17,7 +17,6 @@ set (LIBRARIES
     connectionHandler
     TransportManager
     Utils
-    bluetooth    
 )
 
 set (SOURCES
index c333d37..e4d8bdf 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/request_watchdog/include
   ../../../src/components/utils/include/
   ../../../test/components/request_watchdog/include
index 47d2da9..bd2029a 100644 (file)
@@ -5,8 +5,8 @@ add_subdirectory(./SchemaItem)
 
 include_directories (
   ${CMAKE_SOURCE_DIR}/src/components/utils/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/smart_objects/include
   ../../../src/components/formatters/include/
   ../../../src//thirdPartyLibs/jsoncpp/include/
index 901d164..65f87b6 100644 (file)
@@ -1,7 +1,7 @@
 include_directories (
   ../../../../src/components/utils/include
-  ../../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../../src/components/smart_objects/include
   ../../../../src/components/formatters/include/
   ../../../../src//thirdPartyLibs/jsoncpp/include/
index 48d230d..9696c09 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/include
-  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/include
+  ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ${CMAKE_SOURCE_DIR}/src/components/transport_manager/include
   ${CMAKE_SOURCE_DIR}/src/components/utils/include/
   ${CMAKE_SOURCE_DIR}/src/components/config_profile/include/
index 8796cb5..0d417ae 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/components/utils/include
   ../../../test/components/utils/include
 )
index 86eef10..22c3cec 100644 (file)
@@ -9,14 +9,14 @@
 namespace test  {
 namespace components  {
 namespace utils  {
-  TEST(PrioritizedQueueTest, CommonTests) {
-    ASSERT_TRUE(true);
   struct TestMessage {
     int order;
     int priority;
     int PriorityOrder() const { return priority; }
   };
 
+  TEST(PrioritizedQueueTest, CommonTests) {
+    ASSERT_TRUE(true);
   const size_t kSequenceLength = 8;
   TestMessage input[kSequenceLength] = {
       {0, 0}, {1, 0}, {2, 2}, {3, 0}, {4, 2}, {5, 0}, {6, 9}, {7, 1}
index 8e0cfa0..4cec489 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
 )
 
 set (SOURCES 
index 0d8754c..a017707 100644 (file)
@@ -1,6 +1,6 @@
 include_directories (
-  ../../../src/thirdPartyLibs/gmock-1.6.0/include
-  ../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/include
+  ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
   ../../../src/thirdPartyLibs/jsoncpp/include/
   ../../../test/thirdPartyLibs/jsoncpp/include/
 )
index 1fc5824..a4f41cb 100755 (executable)
@@ -1428,19 +1428,22 @@ class CodeGenerator(object):
         u'''const std::map<${namespace}::${enum}::eType, '''
         u'''std::string> &TEnumSchemaItem<${namespace}::${enum}::eType>::'''
         u'''getEnumElementsStringRepresentation() {\n'''
+        u'''  static bool is_initialized = false;\n'''
         u'''  static std::map<${namespace}::${enum}::eType, '''
-        u'''std::string> enum_string_representation {\n'''
+        u'''std::string> enum_string_representation;\n'''
         u'''\n'''
+        u'''  if (false == is_initialized) {\n'''
         u'''${mapping}'''
         u'''\n'''
-        u'''  };\n'''
+        u'''    is_initialized = true;\n'''
+        u'''  }\n'''
         u'''\n'''
         u'''  return enum_string_representation;\n'''
         u'''}\n''')
 
     _enum_to_str_mapping_template = string.Template(
-        u'''{${namespace}::'''
-        u'''${enum_name}::${enum_value}, "${string}"},''')
+        u'''enum_string_representation.insert(std::make_pair(${namespace}::'''
+        u'''${enum_name}::${enum_value}, "${string}"));''')
 
     _struct_schema_item_template = string.Template(
         u'''utils::SharedPtr<ISchemaItem> struct_schema_item_${name} = '''
index 384e94f..aff817b 100644 (file)
@@ -90,10 +90,10 @@ class BasicRange {
   BasicRange(const std::string& min_str, const std::string& max_str)
       : min_(0),
         max_(0) {
-    bool valid_min = StringToNumber(min(), &min_)
-        && Fraction::FromFloatPointString(min(), &min_fract_);
-    bool valid_max = StringToNumber(max(), &max_)
-        && Fraction::FromFloatPointString(max(), &max_fract_);
+    bool valid_min = StringToNumber(min, &min_)
+        && Fraction::FromFloatPointString(min, &min_fract_);
+    bool valid_max = StringToNumber(max, &max_)
+        && Fraction::FromFloatPointString(max, &max_fract_);
     assert(valid_min && valid_max);
   }
   // Tells if |value| belongs to current range (boundaries are included)