summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2020-08-12 10:55:14 -0400
committerJackLivio <jack@livio.io>2020-08-12 10:55:14 -0400
commit91343b7ea8ea15add24bd536ac52593425ed552e (patch)
tree6af22392aa8a888b71ada9bdd17670f37c6fb4ce
parent53ed0217b075b5cb14f0799292889ea285140097 (diff)
parentcb42c627b837df0ce184ba849c232dd36bd92c91 (diff)
downloadsdl_core-91343b7ea8ea15add24bd536ac52593425ed552e.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/main_menu_updating
# Conflicts: # tools/rpc_spec
-rw-r--r--src/3rd_party/CMakeLists.txt3
-rwxr-xr-xsrc/appMain/hmi_capabilities.json4
-rw-r--r--src/appMain/sdl_preloaded_pt.json227
-rw-r--r--src/components/application_manager/include/application_manager/application.h3
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h31
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h23
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc344
-rw-r--r--src/components/application_manager/src/application_data_impl.cc7
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc35
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc74
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc19
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc7
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h9
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc206
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json12
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json12
-rw-r--r--src/components/config_profile/src/profile.cc12
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h24
-rw-r--r--src/components/interfaces/HMI_API.xml295
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml3
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json24
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json12
-rw-r--r--src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json12
-rw-r--r--src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json12
36 files changed, 1536 insertions, 172 deletions
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index 4415a1bd7b..0fdc0ba013 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -235,7 +235,8 @@ if (NOT ${Boost_FOUND})
include(ExternalProject)
ExternalProject_Add(
Boost
- URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
+ URL https://mirror.bazel.build/dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
+ URL_HASH SHA256=da3411ea45622579d419bfda66f45cd0f8c32a181d84adfa936f5688388995cf
DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem,regex --prefix=${3RD_PARTY_INSTALL_PREFIX}
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 29604f0c2c..417135fcb6 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -324,6 +324,10 @@
"diagonalScreenSize": 8,
"pixelPerInch": 117,
"scale": 1
+ },
+ "driverDistractionCapability": {
+ "menuLength": 10,
+ "subMenuDepth": 3
}
}
},
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index d2aa201d31..f1f00c42d4 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -520,7 +520,9 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "gearStatus",
+ "handsOffSteering"
]
},
"OnVehicleData": {
@@ -537,7 +539,9 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "gearStatus",
+ "handsOffSteering"
]
},
"SubscribeVehicleData": {
@@ -554,7 +558,9 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "gearStatus",
+ "handsOffSteering"
]
},
"UnsubscribeVehicleData": {
@@ -571,7 +577,9 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "gearStatus",
+ "handsOffSteering"
]
}
}
@@ -601,7 +609,9 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"OnVehicleData": {
@@ -626,7 +636,9 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"SubscribeVehicleData": {
@@ -650,7 +662,9 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus",
+ "windowStatus"
]
},
"UnsubscribeVehicleData": {
@@ -674,7 +688,9 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus",
+ "windowStatus"
]
}
}
@@ -3348,13 +3364,17 @@
"type": "Float",
"mandatory": false,
"minvalue": -6,
- "maxvalue": 106
+ "maxvalue": 106,
+ "deprecated": true,
+ "since": "7.0"
},
{
"name": "fuelLevel_State",
"key": "OEM_REF_FUEL_LEV_ST",
"type": "ComponentVolumeStatus",
- "mandatory": false
+ "mandatory": false,
+ "deprecated": true,
+ "since": "7.0"
},
{
"name": "instantFuelConsumption",
@@ -3380,6 +3400,38 @@
"mandatory": false,
"minvalue": 0,
"maxvalue": 10000
+ },
+ {
+ "name": "level",
+ "key": "OEM_REF_FUEL_RAN_LVL",
+ "type": "Float",
+ "minvalue": -6,
+ "maxvalue": 1000000,
+ "mandatory": false,
+ "since": "7.0"
+ },
+ {
+ "name": "levelState",
+ "key": "OEM_REF_FUEL_RAN_LVL_STATE",
+ "type": "ComponentVolumeStatus",
+ "mandatory": false,
+ "since": "7.0"
+ },
+ {
+ "name": "capacity",
+ "key": "OEM_REF_FUEL_RAN_CAP",
+ "type": "Float",
+ "minvalue": 0,
+ "maxvalue": 1000000,
+ "mandatory": false,
+ "since": "7.0"
+ },
+ {
+ "name": "capacityUnit",
+ "key": "OEM_REF_FUEL_RAN_CAP_UNIT",
+ "type": "CapacityUnit",
+ "mandatory": false,
+ "since": "7.0"
}
],
"key": "OEM_REF_FUEL_RAN",
@@ -3417,7 +3469,36 @@
"name": "prndl",
"key": "OEM_REF_PRNDL",
"type": "PRNDL",
- "mandatory": false
+ "mandatory": false,
+ "since": "2.0",
+ "until": "7.0"
+ },
+ {
+ "name": "gearStatus",
+ "params": [
+ {
+ "name": "userSelectedGear",
+ "key": "OEM_REF_USER_GEAR",
+ "type": "PRNDL",
+ "mandatory": false
+ },
+ {
+ "name": "actualGear",
+ "key": "OEM_REF_ACT_GEAR",
+ "type": "PRNDL",
+ "mandatory": false
+ },
+ {
+ "name": "transmissionType",
+ "key": "OEM_REF_TR_TYPE",
+ "type": "TransmissionType",
+ "mandatory": false
+ }
+ ],
+ "key": "OEM_REF_GEAR_STATUS",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "7.0"
},
{
"name": "tirePressure",
@@ -3922,6 +4003,27 @@
"since": "5.0"
},
{
+ "name": "stabilityControlsStatus",
+ "params": [
+ {
+ "name": "escSystem",
+ "key": "OEM_REF_ESC_SYSTEM",
+ "type": "VehicleDataStatus",
+ "mandatory": false
+ },
+ {
+ "name": "trailerSwayControl",
+ "key": "OEM_REF_TRAIL_SW_CTRL",
+ "type": "VehicleDataStatus",
+ "mandatory": false
+ }
+ ],
+ "key": "OEM_REF_STAB_CTRLS_ST",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "7.0"
+ },
+ {
"name": "cloudAppVehicleID",
"key": "OEM_REF_CL_APP_VEH_ID",
"type": "String",
@@ -3929,6 +4031,102 @@
"since": "5.1"
},
{
+ "name": "windowStatus",
+ "params": [
+ {
+ "name": "location",
+ "params": [
+ {
+ "name": "col",
+ "key": "OEM_REF_WND_LOC_COL",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "row",
+ "key": "OEM_REF_WND_LOC_ROW",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "level",
+ "key": "OEM_REF_WND_LOC_LVL",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 0,
+ "minvalue": -1,
+ "maxvalue": 100
+ },
+ {
+ "name": "colspan",
+ "key": "OEM_REF_WND_LOC_COLSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ },
+ {
+ "name": "rowspan",
+ "key": "OEM_REF_WND_LOC_ROWSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ },
+ {
+ "name": "levelspan",
+ "key": "OEM_REF_WND_LOC_LVLSPN",
+ "type": "Integer",
+ "mandatory": false,
+ "defvalue" : 1,
+ "minvalue": 1,
+ "maxvalue": 100
+ }
+ ],
+ "key": "OEM_REF_WND_LOC",
+ "type": "Struct",
+ "mandatory": true
+ },
+ {
+ "name": "state",
+ "params": [
+ {
+ "name": "approximatePosition",
+ "key": "OEM_REF_WND_STATE_APRPOS",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": 0,
+ "maxvalue": 100
+ },
+ {
+ "name": "deviation",
+ "key": "OEM_REF_WND_STATE_DEV",
+ "type": "Integer",
+ "mandatory": true,
+ "minvalue": 0,
+ "maxvalue": 100
+ }
+ ],
+ "key": "OEM_REF_WND_STATE",
+ "type": "Struct",
+ "mandatory": true
+ }
+ ],
+ "key": "OEM_REF_WND_STATUS",
+ "array": true,
+ "type": "Struct",
+ "mandatory": false,
+ "minsize": 0,
+ "maxsize": 100,
+ "since": "7.0"
+ },
+ {
"name": "eCallInfo",
"params": [
{
@@ -4096,6 +4294,13 @@
"key": "OEM_REF_MY_KEY",
"type": "Struct",
"mandatory": false
+ },
+ {
+ "name": "handsOffSteering",
+ "key": "OEM_REF_HANDS_OFF_STRNG",
+ "type": "Boolean",
+ "mandatory": false,
+ "since": "7.0"
}
]
}
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index e9dcf2bcb0..a595fc7379 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -369,7 +369,8 @@ class DynamicApplicationData {
/*
* @brief Returns true if sub menu with such name already exist
*/
- virtual bool IsSubMenuNameAlreadyExist(const std::string& name) = 0;
+ virtual bool IsSubMenuNameAlreadyExist(const std::string& name,
+ const uint32_t parent_id) = 0;
/*
* @brief Adds a interaction choice set to the application
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 5f62c8d5b5..f04d3122fa 100644
--- a/src/components/application_manager/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -194,7 +194,8 @@ class DynamicApplicationDataImpl : public virtual Application {
/*
* @brief Returns true if sub menu with such name already exist
*/
- bool IsSubMenuNameAlreadyExist(const std::string& name);
+ bool IsSubMenuNameAlreadyExist(const std::string& name,
+ const uint32_t parent_id);
void SetWindowInfo(const WindowID window_id,
const smart_objects::SmartObject& window_info) OVERRIDE;
@@ -329,7 +330,7 @@ class DynamicApplicationDataImpl : public virtual Application {
CommandsMap commands_;
mutable std::shared_ptr<sync_primitives::RecursiveLock> commands_lock_ptr_;
SubMenuMap sub_menu_;
- mutable std::shared_ptr<sync_primitives::Lock> sub_menu_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock> sub_menu_lock_ptr_;
ChoiceSetMap choice_set_map_;
mutable std::shared_ptr<sync_primitives::Lock> choice_set_map_lock_ptr_;
PerformChoiceSetMap performinteraction_choice_set_map_;
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
index 089105fdba..1e75499a07 100644
--- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
@@ -194,6 +194,29 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool rc_supported() const OVERRIDE;
+ /*
+ * @brief Interface to store whether HMI supports driver distraction menu
+ * limits
+ *
+ * @param supported Indicates whether driver distraction menu limits is
+ * supported by HMI
+ */
+ void set_driver_distraction_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves whether HMI supports driver distraction menu limits
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool driver_distraction_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the navigation "System Capability"
+ *
+ * @param navigation_capability contains information related
+ * to the navigation system capability.
+ */
void set_navigation_capability(
const smart_objects::SmartObject& navigation_capability) OVERRIDE;
@@ -215,6 +238,12 @@ class HMICapabilitiesImpl : public HMICapabilities {
const smart_objects::SmartObjectSPtr rc_capability() const OVERRIDE;
+ void set_driver_distraction_capability(
+ const smart_objects::SmartObject& driver_distraction_capability) OVERRIDE;
+
+ const smart_objects::SmartObjectSPtr driver_distraction_capability()
+ const OVERRIDE;
+
void set_seat_location_capability(
const smart_objects::SmartObject& seat_location_capability) OVERRIDE;
@@ -444,11 +473,13 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_phone_call_supported_;
bool is_video_streaming_supported_;
bool is_rc_supported_;
+ bool is_driver_distraction_supported_;
std::string ccpu_version_;
smart_objects::SmartObjectSPtr navigation_capability_;
smart_objects::SmartObjectSPtr phone_capability_;
smart_objects::SmartObjectSPtr video_streaming_capability_;
smart_objects::SmartObjectSPtr rc_capability_;
+ smart_objects::SmartObjectSPtr driver_distraction_capability_;
smart_objects::SmartObjectSPtr seat_location_capability_;
ApplicationManager& app_mngr_;
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 74cf37513b..c96c9ebe69 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -119,6 +119,7 @@ extern const char* num_ticks;
extern const char* slider_footer;
extern const char* menu_id;
extern const char* menu_name;
+extern const char* parent_id;
extern const char* menu_layout;
extern const char* menu_layouts_available;
extern const char* interaction_choice_set_id;
@@ -197,6 +198,8 @@ extern const char* navigation_capability;
extern const char* phone_capability;
extern const char* video_streaming_capability;
extern const char* rc_capability;
+extern const char* driver_distraction_capability;
+extern const char* driver_distraction;
extern const char* seat_location_capability;
extern const char* app_services_capabilities;
extern const char* day_color_scheme;
@@ -296,6 +299,7 @@ extern const char* cloud_app_vehicle_id;
extern const char* external_temp;
extern const char* turn_signal;
extern const char* vin;
+extern const char* gearStatus;
extern const char* prndl;
extern const char* tire_pressure;
extern const char* odometer;
@@ -309,6 +313,7 @@ extern const char* head_lamp_status;
extern const char* engine_torque;
extern const char* acc_pedal_pos;
extern const char* steering_wheel_angle;
+extern const char* stability_controls_status;
extern const char* e_call_info;
extern const char* airbag_status;
extern const char* emergency_event;
@@ -334,6 +339,8 @@ extern const char* system_software_version;
extern const char* priority;
extern const char* engine_oil_life;
extern const char* oem_custom_data_type;
+extern const char* window_status;
+extern const char* hands_off_steering;
// app services
extern const char* app_service_manifest;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
index 2f85065ee7..af2ba4a1ea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
@@ -83,22 +83,33 @@ class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
private:
/*
- * @brief Deletes VR commands from SDL for corresponding submenu ID
+ * @brief Deletes submenus that have a parentID that matches the parentID
+ * parameter
*
* @param app_id Application ID
+ * @param parentID Parent ID of a nested submenu
+ */
+ void DeleteNestedSubMenus(app_mngr::ApplicationSharedPtr const app,
+ uint32_t parentID,
+ const app_mngr::SubMenuMap& subMenus);
+
+ /*
+ * @brief Deletes VR commands from SDL for corresponding submenu ID
*
- * @return TRUE on success, otherwise FALSE
+ * @param app_id Application ID
+ * @param parentID Parent ID of a nested submenu
*/
- void DeleteSubMenuVRCommands(app_mngr::ApplicationConstSharedPtr app);
+ void DeleteSubMenuVRCommands(app_mngr::ApplicationConstSharedPtr app,
+ uint32_t parentID);
/*
* @brief Deletes UI commands from SDL for corresponding submenu ID
*
* @param app_id Application ID
- *
- * @return TRUE on success, otherwise FALSE
+ * @param parentID Parent ID of a nested submenu
*/
- void DeleteSubMenuUICommands(app_mngr::ApplicationSharedPtr const app);
+ void DeleteSubMenuUICommands(app_mngr::ApplicationSharedPtr const app,
+ uint32_t parentID);
DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
index c5a76612f6..9f45d174e7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
@@ -141,6 +141,15 @@ void UIGetCapabilitiesResponse::Run() {
hmi_capabilities_.set_video_streaming_capability(
system_capabilities_so[strings::video_streaming_capability]);
}
+ if (system_capabilities_so.keyExists(
+ strings::driver_distraction_capability)) {
+ if (!system_capabilities_so[strings::driver_distraction_capability]
+ .empty()) {
+ hmi_capabilities_.set_driver_distraction_capability(
+ system_capabilities_so[strings::driver_distraction_capability]);
+ hmi_capabilities_.set_driver_distraction_supported(true);
+ }
+ }
if (system_capabilities_so.keyExists(strings::display_capabilities)) {
sections_to_update.push_back(strings::display_capabilities);
hmi_capabilities_.set_system_display_capabilities(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
index 89ccfb8bd7..71bf867054 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -94,7 +94,12 @@ void AddSubMenuRequest::Run() {
const std::string& menu_name =
received_msg_params[strings::menu_name].asString();
- if (app->IsSubMenuNameAlreadyExist(menu_name)) {
+ const uint32_t parent_id =
+ received_msg_params.keyExists(strings::parent_id)
+ ? received_msg_params[strings::parent_id].asUInt()
+ : 0;
+
+ if (app->IsSubMenuNameAlreadyExist(menu_name, parent_id)) {
LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated.");
SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
return;
@@ -130,6 +135,10 @@ void AddSubMenuRequest::Run() {
}
msg_params[strings::menu_params][strings::menu_name] =
received_msg_params[strings::menu_name];
+ if (received_msg_params.keyExists(strings::parent_id)) {
+ msg_params[strings::menu_params][strings::parent_id] = parent_id;
+ }
+
msg_params[strings::app_id] = app->app_id();
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
index 6aaa2406e8..383daa9b83 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
@@ -33,6 +33,7 @@
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/application.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "interfaces/HMI_API.h"
@@ -88,8 +89,41 @@ void DeleteSubMenuRequest::Run() {
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
}
+void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app,
+ uint32_t parentID,
+ const SubMenuMap& subMenus) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SubMenuMap::const_iterator it = subMenus.begin();
+ LOG4CXX_DEBUG(logger_, "Delete Submenus with Parent ID: " << parentID);
+ while (subMenus.end() != it) {
+ if (!(*it->second).keyExists(strings::parent_id)) {
+ LOG4CXX_ERROR(logger_, "parent ID does not exist");
+ ++it;
+ continue;
+ }
+
+ if (parentID == (*it->second)[strings::parent_id].asUInt()) {
+ uint32_t menuID = (*it->second)[strings::menu_id].asUInt();
+ DeleteNestedSubMenus(app, menuID, subMenus);
+ DeleteSubMenuVRCommands(app, menuID);
+ DeleteSubMenuUICommands(app, menuID);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::menu_id] = menuID;
+ msg_params[strings::app_id] = app->app_id();
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params);
+ ++it;
+ LOG4CXX_DEBUG(logger_, "Removing submenuID: " << menuID);
+ app->RemoveSubMenu(menuID);
+ } else {
+ ++it;
+ }
+ }
+}
+
void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
- ApplicationConstSharedPtr app) {
+ ApplicationConstSharedPtr app, uint32_t parentID) {
LOG4CXX_AUTO_TRACE(logger_);
const DataAccessor<CommandsMap> accessor = app->commands_map();
@@ -101,7 +135,7 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
continue;
}
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
+ if (parentID ==
(*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -116,9 +150,9 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
}
void DeleteSubMenuRequest::DeleteSubMenuUICommands(
- ApplicationSharedPtr const app) {
+ ApplicationSharedPtr const app, uint32_t parentID) {
LOG4CXX_AUTO_TRACE(logger_);
-
+ LOG4CXX_DEBUG(logger_, "Delete UI Commands with Parent ID: " << parentID);
const DataAccessor<CommandsMap> accessor(app->commands_map());
const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
@@ -130,13 +164,14 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(
continue;
}
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
- (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ if (parentID ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asUInt()) {
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt();
msg_params[strings::app_id] = app->app_id();
msg_params[strings::cmd_id] = cmd_id;
+ LOG4CXX_DEBUG(logger_, "Removing UI Command: " << cmd_id);
app->RemoveCommand(cmd_id);
app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
it = commands.begin(); // Can not relay on
@@ -174,8 +209,13 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
if (result) {
// delete sub menu items from SDL and HMI
- DeleteSubMenuVRCommands(application);
- DeleteSubMenuUICommands(application);
+ uint32_t parentID =
+ (*message_)[strings::msg_params][strings::menu_id].asUInt();
+ const DataAccessor<SubMenuMap> accessor = application->sub_menu_map();
+ const SubMenuMap& subMenus = accessor.GetData();
+ DeleteNestedSubMenus(application, parentID, subMenus);
+ DeleteSubMenuVRCommands(application, parentID);
+ DeleteSubMenuUICommands(application, parentID);
application->RemoveSubMenu(
(*message_)[strings::msg_params][strings::menu_id].asInt());
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
index 6121747ccc..8b557efc5d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
@@ -163,6 +163,16 @@ void GetSystemCapabilityRequest::Run() {
all_services);
break;
}
+ case mobile_apis::SystemCapabilityType::DRIVER_DISTRACTION:
+ if (hmi_capabilities.driver_distraction_capability()) {
+ response_params[strings::system_capability]
+ [strings::driver_distraction_capability] =
+ *hmi_capabilities.driver_distraction_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
case mobile_apis::SystemCapabilityType::DISPLAYS: {
auto capabilities = hmi_capabilities.system_display_capabilities();
if (app->display_capabilities()) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
index 5fb66c25ac..70bd47e232 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -677,6 +677,8 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params,
response_params[strings::hmi_capabilities][strings::displays] = true;
response_params[strings::hmi_capabilities][strings::seat_location] =
hmi_capabilities.seat_location_capability() ? true : false;
+ response_params[strings::hmi_capabilities][strings::driver_distraction] =
+ hmi_capabilities.driver_distraction_supported();
}
void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
index 926e51446f..00c95b5425 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -60,6 +60,7 @@ using sdl_rpc_plugin::commands::AudioStartStreamRequest;
namespace {
const uint32_t kHmiAppId = 13u;
+const uint32_t kCorrelationId = 2u;
const am::HmiInterfaces::InterfaceID kHmiInterface =
am::HmiInterfaces::HMI_INTERFACE_Navigation;
} // namespace
@@ -74,11 +75,24 @@ class AudioStartStreamRequestTest
command_ = CreateCommand<AudioStartStreamRequest>(msg_);
}
+ void UpdateMsgParams(MessageSharedPtr& message) {
+ (*message)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message)[am::strings::params][am::strings::message_type] =
+ am::MessageType::kRequest;
+ (*message)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(hmi_apis::FunctionID::Navigation_StartAudioStream);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ }
+
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
std::shared_ptr<AudioStartStreamRequest> command_;
+ static const std::string big_url_;
};
+const std::string AudioStartStreamRequestTest::big_url_(20000u, 'a');
+
TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
.WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
@@ -114,6 +128,48 @@ TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
command_->Run();
}
+TEST_F(AudioStartStreamRequestTest, Run_HmiHugeUrl_SentRequest_SUCCESS) {
+ UpdateMsgParams(msg_);
+
+ (*msg_)[am::strings::msg_params][am::strings::url] = big_url_;
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(app_mngr_, application(kHmiAppId)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+
+ EXPECT_CALL(*mock_app, set_audio_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest, ValidateSchema_HmiHugeUrl_SUCCESS) {
+ UpdateMsgParams(msg_);
+
+ (*msg_)[am::strings::params][am::strings::protocol_type] =
+ am::commands::CommandImpl::hmi_protocol_type_;
+ (*msg_)[am::strings::params][am::strings::protocol_version] =
+ am::commands::CommandImpl::protocol_version_;
+
+ (*msg_)[am::strings::msg_params][am::strings::url] = big_url_;
+
+ hmi_apis::HMI_API hmi_so_factory;
+ ns_smart_device_link::ns_smart_objects::CSmartSchema schema;
+ hmi_so_factory.GetSchema(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ hmi_apis::messageType::eType::request,
+ schema);
+
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(smart_objects::errors::eType::OK, schema.validate(*msg_, &report));
+ EXPECT_EQ("", rpc::PrettyFormat(report));
+}
+
} // namespace navi_audio_start_stream_request
} // namespace hmi_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
index 232d5ab628..ba4eefeee1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
@@ -59,6 +59,7 @@ using sdl_rpc_plugin::commands::NaviStartStreamRequest;
namespace {
const uint32_t kHmiAppId = 13u;
+const uint32_t kCorrelationId = 2u;
const am::HmiInterfaces::InterfaceID kHmiInterface =
am::HmiInterfaces::HMI_INTERFACE_Navigation;
} // namespace
@@ -73,11 +74,24 @@ class NaviStartStreamRequestTest
command_ = CreateCommand<NaviStartStreamRequest>(msg_);
}
+ void UpdateMsgParams(MessageSharedPtr& message) {
+ (*message)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message)[am::strings::params][am::strings::message_type] =
+ am::MessageType::kRequest;
+ (*message)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(hmi_apis::FunctionID::Navigation_StartStream);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ }
+
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
std::shared_ptr<NaviStartStreamRequest> command_;
+ static const std::string big_url_;
};
+const std::string NaviStartStreamRequestTest::big_url_(20000u, 'a');
+
TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
.WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
@@ -113,6 +127,48 @@ TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
command_->Run();
}
+TEST_F(NaviStartStreamRequestTest, Run_HmiHugeUrl_SentRequest_SUCCESS) {
+ UpdateMsgParams(msg_);
+
+ (*msg_)[am::strings::msg_params][am::strings::url] = big_url_;
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(app_mngr_, application(kHmiAppId)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+
+ EXPECT_CALL(*mock_app, set_video_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest, ValidateSchema_HmiHugeUrl_SUCCESS) {
+ UpdateMsgParams(msg_);
+
+ (*msg_)[am::strings::params][am::strings::protocol_type] =
+ am::commands::CommandImpl::hmi_protocol_type_;
+ (*msg_)[am::strings::params][am::strings::protocol_version] =
+ am::commands::CommandImpl::protocol_version_;
+
+ (*msg_)[am::strings::msg_params][am::strings::url] = big_url_;
+
+ hmi_apis::HMI_API hmi_so_factory;
+ ns_smart_device_link::ns_smart_objects::CSmartSchema schema;
+ hmi_so_factory.GetSchema(hmi_apis::FunctionID::Navigation_StartStream,
+ hmi_apis::messageType::eType::request,
+ schema);
+
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(smart_objects::errors::eType::OK, schema.validate(*msg_, &report));
+ EXPECT_EQ("", rpc::PrettyFormat(report));
+}
+
} // namespace navi_start_stream_request
} // namespace hmi_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
index 04f12568b4..cd832d3122 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
@@ -98,7 +98,9 @@ class DeleteSubMenuRequestTest
public:
DeleteSubMenuRequestTest()
: commands_lock_(std::make_shared<sync_primitives::Lock>())
+ , sub_menu_lock_(std::make_shared<sync_primitives::RecursiveLock>())
, accessor_(commands_map_, commands_lock_)
+ , sub_menu_accessor_(sub_menu_map_, sub_menu_lock_)
, message_(CreateMessage())
, command_(CreateCommand<DeleteSubMenuRequest>(message_))
, mock_help_prompt_manager_(
@@ -106,8 +108,11 @@ class DeleteSubMenuRequestTest
, app_(CreateMockApp()) {}
am::CommandsMap commands_map_;
+ am::SubMenuMap sub_menu_map_;
mutable std::shared_ptr<sync_primitives::Lock> commands_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock> sub_menu_lock_;
DataAccessor<am::CommandsMap> accessor_;
+ DataAccessor<am::SubMenuMap> sub_menu_accessor_;
MessageSharedPtr message_;
DeleteSubMenuRequestPtr command_;
@@ -266,6 +271,17 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
commands_map_.insert(
std::make_pair(0, &((*message_)[am::strings::msg_params])));
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ std::make_shared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[am::strings::position] = 1;
+ object[am::strings::menu_name] = "SubMenu";
+
+ sub_menu_map_.insert(
+ std::pair<uint32_t, smart_objects::SmartObject*>(5, &object));
+ EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
InSequence seq;
@@ -330,6 +346,7 @@ TEST_F(DeleteSubMenuRequestTest,
std::make_pair(0, &((*message_)[am::strings::msg_params])));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
@@ -357,6 +374,7 @@ TEST_F(DeleteSubMenuRequestTest,
std::make_pair(0, &((*message_)[am::strings::msg_params])));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
index ffa7203f1f..93ccf6c435 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -77,10 +77,25 @@ class OnSystemRequestNotificationTest
ON_CALL(*mock_app_, device()).WillByDefault(Return(kDeviceId));
}
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
+ const mobile_apis::RequestType::eType request_type =
+ RequestType::NAVIGATION;
+ (*message)[strings::msg_params][strings::request_type] = request_type;
+ return message;
+ }
+
+ static const std::string big_url_;
+
protected:
MockAppPtr mock_app_;
};
+const std::string OnSystemRequestNotificationTest::big_url_(20000u, 'a');
+
TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::PROPRIETARY;
@@ -160,6 +175,56 @@ TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
(*msg)[strings::params][strings::protocol_version].asInt());
}
+TEST_F(OnSystemRequestNotificationTest, Run_NavigationHugeUrl_SUCCESS) {
+ MessageSharedPtr msg = CreateBasicMessage();
+
+ (*msg)[strings::msg_params][strings::url] = big_url_;
+
+ auto command = CreateCommand<OnSystemRequestNotification>(msg);
+
+ PreConditions();
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(
+ mock_policy_handler_,
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, RequestType::NAVIGATION))
+ .WillByDefault(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, false));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest,
+ ValidateSchema_NavigationHugeUrl_SUCCESS) {
+ MessageSharedPtr msg = CreateBasicMessage();
+
+ (*msg)[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+ (*msg)[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ (*msg)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ (*msg)[strings::msg_params][strings::url] = big_url_;
+
+ mobile_apis::MOBILE_API mobile_so_factoy;
+ ns_smart_device_link::ns_smart_objects::CSmartSchema schema;
+ mobile_so_factoy.GetSchema(mobile_apis::FunctionID::eType::OnSystemRequestID,
+ mobile_apis::messageType::eType::notification,
+ schema);
+
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(smart_objects::errors::eType::OK, schema.validate(*msg, &report));
+ EXPECT_EQ("", rpc::PrettyFormat(report));
+}
+
TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
const mobile_apis::RequestType::eType request_type =
mobile_apis::RequestType::HTTP;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc
new file mode 100644
index 0000000000..c559268bfd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/subscribe_vehicle_request_test.cc
@@ -0,0 +1,344 @@
+/*
+ Copyright (c) 2020, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/subscribe_vehicle_data_request.h"
+#include "resumption/last_state_wrapper_impl.h"
+#include "resumption/mock_last_state.h"
+#include "vehicle_info_plugin/commands/vi_command_request_test.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+
+#include "application_manager/mock_rpc_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_vehicle_data_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::SubscribeVehicleDataRequest;
+
+typedef std::shared_ptr<SubscribeVehicleDataRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kMsgParamKey = "test_key";
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS;
+const std::string kVehicleTypeStr = am::strings::window_status;
+} // namespace
+
+class SubscribeVehicleRequestTest
+ : public VICommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SubscribeVehicleRequestTest()
+ : mock_app_(CreateMockApp())
+ , vi_app_extension_ptr_(
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin_, *mock_app_))
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_last_state_(std::make_shared<resumption::LastStateWrapperImpl>(
+ std::make_shared<resumption_test::MockLastState>())) {}
+
+ protected:
+ void SubscribeSuccessfully();
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, GetRPCHandler())
+ .WillByDefault(ReturnRef(mock_rpc_handler_));
+
+ vi_plugin_.Init(app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_last_state_);
+ ON_CALL(*mock_app_, AddExtension(vi_app_extension_ptr_));
+ vi_plugin_.OnApplicationEvent(application_manager::plugin_manager::
+ ApplicationEvent::kApplicationRegistered,
+ mock_app_);
+ ON_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillByDefault(Return(vi_app_extension_ptr_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ MockAppPtr mock_app_;
+ application_manager::AppExtensionPtr vi_app_extension_ptr_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin_;
+ application_manager_test::MockRPCHandler mock_rpc_handler_;
+ resumption::LastStateWrapperPtr mock_last_state_;
+};
+
+TEST_F(SubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, Run_DataToSubscribeIsNotExisted_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ kVehicleTypeStr;
+
+ am::VehicleData empty_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(empty_data));
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest,
+ Run_EmptyVehicleData_INVALID_DATA_SentToMobile) {
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = false;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest,
+ Run_SubscribeDataNotIncludedToRequest_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject empty_hmi_custom_params;
+ const std::set<std::string> hmi_message_params;
+ ON_CALL(mock_custom_vehicle_data_manager_,
+ CreateHMIMessageParams(hmi_message_params))
+ .WillByDefault(Return(empty_hmi_custom_params));
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, Run_Subscribe_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_SDL))
+ .WillRepeatedly(Return(
+ application_manager::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+
+ application_manager::ApplicationSet app_set = {mock_app_};
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_ptr_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData),
+ _));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_WrongEvent_FAIL) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ test_event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_AppNotRegistered_FAIL) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(nullptr));
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ test_event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+TEST_F(SubscribeVehicleRequestTest, OnEvent_DataSubscribed_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params]
+ [application_manager::strings::window_status] = true;
+ CommandPtr command(CreateCommandVI<SubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kVehicleTypeStr] = true;
+ test_event.set_smart_object(message);
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ kVehicleTypeStr, mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(vehicle_data));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ ASSERT_TRUE(command->Init());
+ command->on_event(test_event);
+}
+
+} // namespace subscribe_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index a5b5827f2f..0bf992d68b 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -205,7 +205,7 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, commands_()
, commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, sub_menu_()
- , sub_menu_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , sub_menu_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, choice_set_map_()
, choice_set_map_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, performinteraction_choice_set_map_()
@@ -855,12 +855,13 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
}
bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
- const std::string& name) {
+ const std::string& name, const uint32_t parent_id) {
sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
for (SubMenuMap::iterator it = sub_menu_.begin(); sub_menu_.end() != it;
++it) {
smart_objects::SmartObject* menu = it->second;
- if ((*menu)[strings::menu_name] == name) {
+ if ((*menu)[strings::menu_name].asString() == name &&
+ (*menu)[strings::parent_id].asInt() == parent_id) {
return true;
}
}
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index 11300bc684..c5ab78ade5 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -495,10 +495,12 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, is_phone_call_supported_(false)
, is_video_streaming_supported_(false)
, is_rc_supported_(false)
+ , is_driver_distraction_supported_(false)
, navigation_capability_(NULL)
, phone_capability_(NULL)
, video_streaming_capability_(NULL)
, rc_capability_(NULL)
+ , driver_distraction_capability_(NULL)
, seat_location_capability_(NULL)
, app_mngr_(app_mngr)
, hmi_language_handler_(app_mngr) {
@@ -729,6 +731,11 @@ void HMICapabilitiesImpl::set_rc_supported(const bool supported) {
is_rc_supported_ = supported;
}
+void HMICapabilitiesImpl::set_driver_distraction_supported(
+ const bool supported) {
+ is_driver_distraction_supported_ = supported;
+}
+
void HMICapabilitiesImpl::set_navigation_capability(
const smart_objects::SmartObject& navigation_capability) {
auto new_value =
@@ -756,6 +763,13 @@ void HMICapabilitiesImpl::set_rc_capability(
rc_capability_.swap(new_value);
}
+void HMICapabilitiesImpl::set_driver_distraction_capability(
+ const smart_objects::SmartObject& driver_distraction_capability) {
+ auto new_value = std::make_shared<smart_objects::SmartObject>(
+ driver_distraction_capability);
+ driver_distraction_capability_.swap(new_value);
+}
+
void HMICapabilitiesImpl::set_seat_location_capability(
const smart_objects::SmartObject& seat_location_capability) {
auto new_value =
@@ -895,6 +909,10 @@ bool HMICapabilitiesImpl::rc_supported() const {
return is_rc_supported_;
}
+bool HMICapabilitiesImpl::driver_distraction_supported() const {
+ return is_driver_distraction_supported_;
+}
+
const smart_objects::SmartObjectSPtr
HMICapabilitiesImpl::navigation_capability() const {
return navigation_capability_;
@@ -916,6 +934,11 @@ const smart_objects::SmartObjectSPtr HMICapabilitiesImpl::rc_capability()
}
const smart_objects::SmartObjectSPtr
+HMICapabilitiesImpl::driver_distraction_capability() const {
+ return driver_distraction_capability_;
+}
+
+const smart_objects::SmartObjectSPtr
HMICapabilitiesImpl::seat_location_capability() const {
return seat_location_capability_;
}
@@ -1419,6 +1442,18 @@ bool HMICapabilitiesImpl::LoadCapabilitiesFromFile() {
set_video_streaming_supported(true);
}
}
+ if (JsonIsMemberSafe(ui_system_capabilities_node,
+ strings::driver_distraction_capability)) {
+ Json::Value dd_capability = ui_system_capabilities_node.get(
+ strings::driver_distraction_capability, "");
+ smart_objects::SmartObject dd_capability_so;
+ formatters::CFormatterJsonBase::jsonValueToObj(dd_capability,
+ dd_capability_so);
+ set_driver_distraction_capability(dd_capability_so);
+ if (!dd_capability_so.empty()) {
+ set_driver_distraction_supported(true);
+ }
+ }
}
} else {
AddRequiredRequestsForCapabilities(hmi_interface::ui);
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index d6fbed115b..d351ea91b8 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -189,6 +189,8 @@ std::pair<std::string, mobile_apis::VehicleDataType::eType>
mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL),
std::make_pair(strings::vin,
mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
+ std::make_pair(strings::gearStatus,
+ mobile_apis::VehicleDataType::VEHICLEDATA_GEARSTATUS),
std::make_pair(strings::prndl,
mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
std::make_pair(strings::tire_pressure,
@@ -211,6 +213,9 @@ std::pair<std::string, mobile_apis::VehicleDataType::eType>
std::make_pair(
strings::head_lamp_status,
mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
+ std::make_pair(
+ strings::stability_controls_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_STABILITYCONTROLSSTATUS),
std::make_pair(strings::e_call_info,
mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
std::make_pair(strings::airbag_status,
@@ -237,9 +242,13 @@ std::pair<std::string, mobile_apis::VehicleDataType::eType>
mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
std::make_pair(strings::steering_wheel_angle,
mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
+ std::make_pair(strings::engine_oil_life,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE),
+ std::make_pair(strings::window_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WINDOWSTATUS),
std::make_pair(
- strings::engine_oil_life,
- mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
+ strings::hands_off_steering,
+ mobile_apis::VehicleDataType::VEHICLEDATA_HANDSOFFSTEERING)};
const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
@@ -1108,8 +1117,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
return;
}
- DataAccessor<ButtonSubscriptions> button_accessor = app->SubscribedButtons();
- ButtonSubscriptions subscriptions = button_accessor.GetData();
+ const ButtonSubscriptions subscriptions = app->SubscribedButtons().GetData();
ButtonSubscriptions::iterator it = subscriptions.begin();
for (; subscriptions.end() != it; ++it) {
SendOnButtonSubscriptionNotification(
@@ -1877,6 +1885,10 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
(*i->second)[strings::position];
msg_params[strings::menu_params][strings::menu_name] =
(*i->second)[strings::menu_name];
+ if ((*i->second).keyExists(strings::parent_id)) {
+ msg_params[strings::menu_params][strings::parent_id] =
+ (*i->second)[strings::parent_id];
+ }
msg_params[strings::app_id] = app->app_id();
(*ui_sub_menu)[strings::msg_params] = msg_params;
if (((*i->second).keyExists(strings::menu_icon)) &&
@@ -2366,25 +2378,20 @@ void MessageHelper::SendNaviStartStream(const int32_t app_id,
(*start_stream)[strings::params][strings::function_id] =
hmi_apis::FunctionID::Navigation_StartStream;
- char url[100] = {'\0'};
+ std::string url;
if ("socket" == app_mngr.get_settings().video_server_type()) {
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "http://%s:%d",
- app_mngr.get_settings().server_address().c_str(),
- app_mngr.get_settings().video_streaming_port());
+ auto const port = app_mngr.get_settings().video_streaming_port();
+ url = "http://";
+ url += app_mngr.get_settings().server_address();
+ url += ":";
+ url += std::to_string(port);
} else if ("pipe" == app_mngr.get_settings().video_server_type()) {
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "%s",
- app_mngr.get_settings().named_video_pipe_path().c_str());
+ url.reserve(PATH_MAX);
+ url.insert(
+ 0, app_mngr.get_settings().named_video_pipe_path(), 0, PATH_MAX - 1);
} else {
- int snprintf_result =
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "%s",
- app_mngr.get_settings().video_stream_file().c_str());
- DCHECK(snprintf_result);
+ url.reserve(PATH_MAX);
+ url.insert(0, app_mngr.get_settings().video_stream_file(), 0, PATH_MAX - 1);
}
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
@@ -2423,25 +2430,20 @@ void MessageHelper::SendAudioStartStream(const int32_t app_id,
(*start_stream)[strings::params][strings::function_id] =
hmi_apis::FunctionID::Navigation_StartAudioStream;
- char url[100] = {'\0'};
+ std::string url;
if ("socket" == app_mngr.get_settings().audio_server_type()) {
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "http://%s:%d",
- app_mngr.get_settings().server_address().c_str(),
- app_mngr.get_settings().audio_streaming_port());
+ auto const port = app_mngr.get_settings().audio_streaming_port();
+ url = "http://";
+ url += app_mngr.get_settings().server_address();
+ url += ":";
+ url += std::to_string(port);
} else if ("pipe" == app_mngr.get_settings().audio_server_type()) {
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "%s",
- app_mngr.get_settings().named_audio_pipe_path().c_str());
+ url.reserve(PATH_MAX);
+ url.insert(
+ 0, app_mngr.get_settings().named_audio_pipe_path(), 0, PATH_MAX - 1);
} else {
- int snprintf_result =
- snprintf(url,
- sizeof(url) / sizeof(url[0]),
- "%s",
- app_mngr.get_settings().audio_stream_file().c_str());
- DCHECK(snprintf_result);
+ url.reserve(PATH_MAX);
+ url.insert(0, app_mngr.get_settings().audio_stream_file(), 0, PATH_MAX - 1);
}
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 9046fe35ad..0312975fec 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -148,20 +148,23 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions(
}
LOG4CXX_DEBUG(logger_, "app_id:" << application->app_id());
- DataAccessor<ButtonSubscriptions> button_accessor =
- application->SubscribedButtons();
+ {
+ DataAccessor<ButtonSubscriptions> button_accessor =
+ application->SubscribedButtons();
- const ButtonSubscriptions& button_subscriptions = button_accessor.GetData();
+ const ButtonSubscriptions& button_subscriptions = button_accessor.GetData();
- LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << button_subscriptions.size());
- Append(button_subscriptions.begin(),
- button_subscriptions.end(),
- strings::application_buttons,
- subscriptions);
+ LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << button_subscriptions.size());
+ Append(button_subscriptions.begin(),
+ button_subscriptions.end(),
+ strings::application_buttons,
+ subscriptions);
+ }
for (auto extension : application->Extensions()) {
extension->SaveResumptionData(subscriptions);
}
+
return subscriptions;
}
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index e0204fd6c7..f95476b7a6 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -85,6 +85,7 @@ const char* user_location = "userLocation";
const char* num_ticks = "numTicks";
const char* slider_footer = "sliderFooter";
const char* menu_id = "menuID";
+const char* parent_id = "parentID";
const char* menu_name = "menuName";
const char* menu_layout = "menuLayout";
const char* menu_layouts_available = "menuLayoutsAvailable";
@@ -163,6 +164,8 @@ const char* system_capabilities = "systemCapabilities";
const char* navigation_capability = "navigationCapability";
const char* phone_capability = "phoneCapability";
const char* video_streaming_capability = "videoStreamingCapability";
+const char* driver_distraction_capability = "driverDistractionCapability";
+const char* driver_distraction = "driverDistraction";
const char* rc_capability = "remoteControlCapability";
const char* seat_location_capability = "seatLocationCapability";
const char* app_services_capabilities = "appServicesCapabilities";
@@ -263,6 +266,7 @@ const char* cloud_app_vehicle_id = "cloudAppVehicleID";
const char* external_temp = "externalTemperature";
const char* turn_signal = "turnSignal";
const char* vin = "vin";
+const char* gearStatus = "gearStatus";
const char* prndl = "prndl";
const char* tire_pressure = "tirePressure";
const char* odometer = "odometer";
@@ -276,6 +280,7 @@ const char* head_lamp_status = "headLampStatus";
const char* engine_torque = "engineTorque";
const char* acc_pedal_pos = "accPedalPosition";
const char* steering_wheel_angle = "steeringWheelAngle";
+const char* stability_controls_status = "stabilityControlsStatus";
const char* e_call_info = "eCallInfo";
const char* airbag_status = "airbagStatus";
const char* emergency_event = "emergencyEvent";
@@ -301,6 +306,8 @@ const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
const char* engine_oil_life = "engineOilLife";
const char* oem_custom_data_type = "oemCustomDataType";
+const char* window_status = "windowStatus";
+const char* hands_off_steering = "handsOffSteering";
// app services
const char* app_service_manifest = "appServiceManifest";
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 362dda4efb..175c39513e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -321,7 +321,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id));
MOCK_CONST_METHOD1(FindSubMenu,
smart_objects::SmartObject*(uint32_t menu_id));
- MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name));
+ MOCK_METHOD2(IsSubMenuNameAlreadyExist,
+ bool(const std::string& name, const uint32_t parent_id));
MOCK_METHOD2(AddChoiceSet,
void(uint32_t choice_set_id,
const smart_objects::SmartObject& choice_set));
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
index 6d428eda24..2f9f40ad2a 100644
--- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
@@ -172,6 +172,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(rc_supported, bool());
MOCK_METHOD1(set_rc_supported, void(const bool supported));
+ MOCK_CONST_METHOD0(driver_distraction_supported, bool());
+ MOCK_METHOD1(set_driver_distraction_supported, void(const bool supported));
+
MOCK_CONST_METHOD0(navigation_capability,
const smart_objects::SmartObjectSPtr());
MOCK_METHOD1(set_navigation_capability,
@@ -190,6 +193,12 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_METHOD1(set_rc_capability,
void(const smart_objects::SmartObject& rc_capability));
+ MOCK_CONST_METHOD0(driver_distraction_capability,
+ const smart_objects::SmartObjectSPtr());
+ MOCK_METHOD1(
+ set_driver_distraction_capability,
+ void(const smart_objects::SmartObject& driver_distraction_capability));
+
MOCK_CONST_METHOD0(seat_location_capability,
const smart_objects::SmartObjectSPtr());
MOCK_METHOD1(
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index f85c569bdb..1a033fe87a 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
#include <string>
#include <vector>
@@ -40,12 +41,14 @@
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_rpc_service.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/state_controller.h"
#include "policy/mock_policy_settings.h"
+#include "smart_objects/enum_schema_item.h"
#include "utils/custom_string.h"
#include "utils/lock.h"
@@ -77,6 +80,11 @@ using testing::ReturnRef;
using testing::ReturnRefOfCopy;
using testing::SaveArg;
+namespace {
+const uint32_t kAppId = 123u;
+const uint32_t kCorrelationId_ = 1939u;
+} // namespace
+
TEST(MessageHelperTestCreate,
CreateBlockedByPoliciesResponse_SmartObject_Equal) {
mobile_apis::FunctionID::eType function_id =
@@ -602,9 +610,21 @@ class MessageHelperTest : public ::testing::Test {
, hmi_level_strings{"FULL", "LIMITED", "BACKGROUND", "NONE"}
, delta_from_functions_id(32768) {}
+ void StartStreamPreConditions() {
+ ON_CALL(mock_application_manager_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId_));
+ ON_CALL(mock_application_manager_, get_settings())
+ .WillByDefault(ReturnRef(mock_app_mngr_settings_));
+ ON_CALL(mock_application_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ }
+
protected:
- application_manager_test::MockApplicationManager mock_application_manager;
- application_manager_test::MockRPCService mock_rpc_service_;
+ testing::NiceMock<application_manager_test::MockApplicationManager>
+ mock_application_manager_;
+ testing::NiceMock<application_manager_test::MockApplicationManagerSettings>
+ mock_app_mngr_settings_;
+ testing::NiceMock<application_manager_test::MockRPCService> mock_rpc_service_;
const StringArray language_strings;
const StringArray hmi_result_strings;
const StringArray mobile_result_strings;
@@ -748,10 +768,10 @@ TEST_F(MessageHelperTest,
smart_objects::SmartObject object;
policy_handler_test::MockPolicySettings policy_settings_;
const policy::PolicyHandler policy_handler(policy_settings_,
- mock_application_manager);
+ mock_application_manager_);
// Method call
mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons(
- object, appSharedMock, policy_handler, mock_application_manager);
+ object, appSharedMock, policy_handler, mock_application_manager_);
// Expect
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
}
@@ -767,10 +787,10 @@ TEST_F(MessageHelperTest,
buttons[0][strings::image][strings::value] = "invalid\\nvalue";
policy_handler_test::MockPolicySettings policy_settings_;
const policy::PolicyHandler policy_handler(policy_settings_,
- mock_application_manager);
+ mock_application_manager_);
// Method call
mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons(
- object, appSharedMock, policy_handler, mock_application_manager);
+ object, appSharedMock, policy_handler, mock_application_manager_);
// Expect
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
@@ -784,7 +804,7 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
image[strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
- image, appSharedMock, mock_application_manager);
+ image, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
}
@@ -799,7 +819,7 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
image[strings::value] = " ";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
- image, appSharedMock, mock_application_manager);
+ image, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
@@ -813,7 +833,7 @@ TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) {
image[strings::value] = "icon.png";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
- image, appSharedMock, mock_application_manager);
+ image, appSharedMock, mock_application_manager_);
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
// EXPECT
EXPECT_EQ("icon.png", image[strings::value].asString());
@@ -829,7 +849,7 @@ TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) {
image[strings::value] = " ";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
- image, appSharedMock, mock_application_manager);
+ image, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
@@ -845,7 +865,7 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
images[1][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
- images, appSharedMock, mock_application_manager);
+ images, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
}
@@ -863,7 +883,7 @@ TEST_F(MessageHelperTest,
images[1][strings::value] = "image\\n";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
- images, appSharedMock, mock_application_manager);
+ images, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
@@ -883,7 +903,7 @@ TEST_F(MessageHelperTest,
message[1][strings::image][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
- message, appSharedMock, mock_application_manager);
+ message, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
}
@@ -903,7 +923,7 @@ TEST_F(MessageHelperTest,
message[1][strings::image][strings::value] = "image\\n";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
- message, appSharedMock, mock_application_manager);
+ message, appSharedMock, mock_application_manager_);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
@@ -973,7 +993,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
smart_objects::SmartObjectSPtr result;
- ON_CALL(mock_application_manager, GetRPCService())
+ ON_CALL(mock_application_manager_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
@@ -982,7 +1002,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
MessageHelper::SendGetListOfPermissionsResponse(permissions,
external_consent_status,
correlation_id,
- mock_application_manager);
+ mock_application_manager_);
ASSERT_TRUE(result.get());
@@ -1013,7 +1033,7 @@ TEST_F(MessageHelperTest,
smart_objects::SmartObjectSPtr result;
- ON_CALL(mock_application_manager, GetRPCService())
+ ON_CALL(mock_application_manager_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
@@ -1022,7 +1042,7 @@ TEST_F(MessageHelperTest,
MessageHelper::SendGetListOfPermissionsResponse(permissions,
external_consent_status,
correlation_id,
- mock_application_manager);
+ mock_application_manager_);
ASSERT_TRUE(result.get());
@@ -1059,7 +1079,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
smart_objects::SmartObjectSPtr result;
- ON_CALL(mock_application_manager, GetRPCService())
+ ON_CALL(mock_application_manager_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
@@ -1073,7 +1093,7 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
video_params[strings::height] = 480;
MessageHelper::SendNaviSetVideoConfig(
- app_id, mock_application_manager, video_params);
+ app_id, mock_application_manager_, video_params);
EXPECT_EQ(hmi_apis::FunctionID::Navigation_SetVideoConfig,
(*result)[strings::params][strings::function_id].asInt());
@@ -1091,6 +1111,120 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
EXPECT_EQ(480, msg_params[strings::config][strings::height].asInt());
}
+TEST_F(MessageHelperTest,
+ SendAudioStartStream_SendAudioStreamUrl_MaxPath_Equal) {
+ // baskslash-2 and place for a null character-1
+ auto const special_characters = 3;
+ std::string audio_stream_file = "/";
+ audio_stream_file +=
+ std::string(PATH_MAX - NAME_MAX - special_characters, 'u') + "/";
+ audio_stream_file += std::string(NAME_MAX, 'u');
+ std::string audio_server_type;
+ smart_objects::SmartObjectSPtr start_stream;
+
+ StartStreamPreConditions();
+
+ ON_CALL(mock_app_mngr_settings_, audio_server_type())
+ .WillByDefault(ReturnRef(audio_server_type));
+ ON_CALL(mock_app_mngr_settings_, audio_stream_file())
+ .WillByDefault(ReturnRef(audio_stream_file));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillByDefault(DoAll(SaveArg<0>(&start_stream), Return(true)));
+
+ MessageHelper::SendAudioStartStream(kAppId, mock_application_manager_);
+
+ smart_objects::SmartObject& msg_params = (*start_stream)[strings::msg_params];
+
+ EXPECT_TRUE(msg_params.keyExists(strings::url));
+ EXPECT_EQ(msg_params[strings::url], audio_stream_file);
+}
+
+TEST_F(MessageHelperTest,
+ SendAudioStartStream_SendAudioStreamUrl_ViolationOfLimits_NotEqual) {
+ // baskslash-2 and place for a null character-1
+ auto const special_characters = 3;
+ std::string audio_stream_file = "/";
+ audio_stream_file +=
+ std::string(PATH_MAX - NAME_MAX - special_characters, 'u') + "/";
+ audio_stream_file += std::string(NAME_MAX + 1, 'u');
+ std::string audio_server_type;
+ smart_objects::SmartObjectSPtr start_stream;
+
+ StartStreamPreConditions();
+
+ ON_CALL(mock_app_mngr_settings_, audio_server_type())
+ .WillByDefault(ReturnRef(audio_server_type));
+ ON_CALL(mock_app_mngr_settings_, audio_stream_file())
+ .WillByDefault(ReturnRef(audio_stream_file));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillByDefault(DoAll(SaveArg<0>(&start_stream), Return(true)));
+
+ MessageHelper::SendAudioStartStream(kAppId, mock_application_manager_);
+
+ smart_objects::SmartObject& msg_params = (*start_stream)[strings::msg_params];
+
+ EXPECT_TRUE(msg_params.keyExists(strings::url));
+ EXPECT_STRNE(msg_params[strings::url].asCharArray(),
+ audio_stream_file.c_str());
+}
+
+TEST_F(MessageHelperTest,
+ SendNaviStartStream_SendVideoStreamUrl_MaxPath_Equal) {
+ // baskslash-2 and place for a null character-1
+ auto const special_characters = 3;
+ std::string video_stream_file = "/";
+ video_stream_file +=
+ std::string(PATH_MAX - NAME_MAX - special_characters, 'u') + "/";
+ video_stream_file += std::string(NAME_MAX, 'u');
+ std::string video_server_type;
+ smart_objects::SmartObjectSPtr start_stream;
+
+ StartStreamPreConditions();
+
+ ON_CALL(mock_app_mngr_settings_, video_server_type())
+ .WillByDefault(ReturnRef(video_server_type));
+ ON_CALL(mock_app_mngr_settings_, video_stream_file())
+ .WillByDefault(ReturnRef(video_stream_file));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillByDefault(DoAll(SaveArg<0>(&start_stream), Return(true)));
+
+ MessageHelper::SendNaviStartStream(kAppId, mock_application_manager_);
+
+ smart_objects::SmartObject& msg_params = (*start_stream)[strings::msg_params];
+
+ EXPECT_TRUE(msg_params.keyExists(strings::url));
+ EXPECT_EQ(msg_params[strings::url], video_stream_file);
+}
+
+TEST_F(MessageHelperTest,
+ SendNaviStartStream_SendVideoStreamUrl_ViolationOfLimits_NotEqual) {
+ // baskslash-2 and place for a null character-1
+ auto const special_characters = 3;
+ std::string video_stream_file = "/";
+ video_stream_file +=
+ std::string(PATH_MAX - NAME_MAX - special_characters, 'u') + "/";
+ video_stream_file += std::string(NAME_MAX + 1, 'u');
+ std::string video_server_type;
+ smart_objects::SmartObjectSPtr start_stream;
+
+ StartStreamPreConditions();
+
+ ON_CALL(mock_app_mngr_settings_, video_server_type())
+ .WillByDefault(ReturnRef(video_server_type));
+ ON_CALL(mock_app_mngr_settings_, video_stream_file())
+ .WillByDefault(ReturnRef(video_stream_file));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillByDefault(DoAll(SaveArg<0>(&start_stream), Return(true)));
+
+ MessageHelper::SendNaviStartStream(kAppId, mock_application_manager_);
+
+ smart_objects::SmartObject& msg_params = (*start_stream)[strings::msg_params];
+
+ EXPECT_TRUE(msg_params.keyExists(strings::url));
+ EXPECT_STRNE(msg_params[strings::url].asCharArray(),
+ video_stream_file.c_str());
+}
+
TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_SUCCESS) {
const WindowID window_id = 145;
smart_objects::SmartObject message(smart_objects::SmartType_Map);
@@ -1112,6 +1246,38 @@ TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_FromWrongType) {
MessageHelper::ExtractWindowIdFromSmartObject(message));
}
+TEST_F(MessageHelperTest,
+ VehicleDataMapping_ContainsGeneratedVehicleTypes_SUCCESS) {
+ using VehicleDataTypeEnum = mobile_apis::VehicleDataType::eType;
+ using VehicleDataTypes =
+ smart_objects::EnumConversionHelper<VehicleDataTypeEnum>;
+
+ const auto& vehicle_data_mapping = MessageHelper::vehicle_data();
+ const auto& enum_map = VehicleDataTypes::enum_to_cstring_map();
+
+ // Values which vehicle_data_mapping doesn't contain
+ const std::vector<VehicleDataTypeEnum> excluded_values = {
+ VehicleDataTypeEnum::INVALID_ENUM,
+ VehicleDataTypeEnum::VEHICLEDATA_OEM_CUSTOM_DATA,
+ VehicleDataTypeEnum::VEHICLEDATA_BATTVOLTAGE};
+
+ for (const auto& enum_item : enum_map) {
+ const auto& excluded_value = std::find(
+ excluded_values.begin(), excluded_values.end(), enum_item.first);
+ if (excluded_value != excluded_values.end()) {
+ continue;
+ }
+
+ const auto& found_value = std::find_if(
+ vehicle_data_mapping.begin(),
+ vehicle_data_mapping.end(),
+ [&enum_item](const std::pair<std::string, VehicleDataTypeEnum>& item)
+ -> bool { return enum_item.first == item.second; });
+
+ EXPECT_NE(found_value, vehicle_data_mapping.end());
+ }
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index ad264c8518..e4818353d1 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -367,7 +367,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"]
+ "wiperStatus",
+ "stabilityControlsStatus"]
},
"OnVehicleData": {
"hmi_levels": ["BACKGROUND",
@@ -388,7 +389,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"]
+ "wiperStatus",
+ "stabilityControlsStatus"]
},
"SubscribeVehicleData": {
"hmi_levels": ["BACKGROUND",
@@ -408,7 +410,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"]
+ "wiperStatus",
+ "stabilityControlsStatus"]
},
"UnsubscribeVehicleData": {
"hmi_levels": ["BACKGROUND",
@@ -428,7 +431,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"]
+ "wiperStatus",
+ "stabilityControlsStatus"]
}
}
},
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index aea3f7700b..205a962cc8 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -1610,7 +1610,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"OnVehicleData" : {
@@ -1629,7 +1630,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"SubscribeVehicleData" : {
@@ -1647,7 +1649,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"UnsubscribeVehicleData" : {
@@ -1665,7 +1668,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
}
},
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 00fd546a02..26e5bb0c54 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -1552,7 +1552,8 @@ void Profile::UpdateValues() {
kMediaManagerSection,
kNamedVideoPipePathKey);
- named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_;
+ named_video_pipe_path_ = app_storage_folder_ + "/" +
+ std::string(named_video_pipe_path_, 0, NAME_MAX);
LOG_UPDATED_VALUE(
named_video_pipe_path_, kNamedVideoPipePathKey, kMediaManagerSection);
@@ -1563,7 +1564,8 @@ void Profile::UpdateValues() {
kMediaManagerSection,
kNamedAudioPipePathKey);
- named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_;
+ named_audio_pipe_path_ = app_storage_folder_ + "/" +
+ std::string(named_audio_pipe_path_, 0, NAME_MAX);
LOG_UPDATED_VALUE(
named_audio_pipe_path_, kNamedAudioPipePathKey, kMediaManagerSection);
@@ -1572,7 +1574,8 @@ void Profile::UpdateValues() {
ReadStringValue(
&video_stream_file_, "", kMediaManagerSection, kVideoStreamFileKey);
- video_stream_file_ = app_storage_folder_ + "/" + video_stream_file_;
+ video_stream_file_ =
+ app_storage_folder_ + "/" + std::string(video_stream_file_, 0, NAME_MAX);
LOG_UPDATED_VALUE(
video_stream_file_, kVideoStreamFileKey, kMediaManagerSection);
@@ -1581,7 +1584,8 @@ void Profile::UpdateValues() {
ReadStringValue(
&audio_stream_file_, "", kMediaManagerSection, kAudioStreamFileKey);
- audio_stream_file_ = app_storage_folder_ + "/" + audio_stream_file_;
+ audio_stream_file_ =
+ app_storage_folder_ + "/" + std::string(audio_stream_file_, 0, NAME_MAX);
LOG_UPDATED_VALUE(
audio_stream_file_, kAudioStreamFileKey, kMediaManagerSection);
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 0948a4e6ad..56ac807d63 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -408,7 +408,23 @@ class HMICapabilities {
*/
virtual bool rc_supported() const = 0;
- /**
+ /*
+ * @brief Interface to store whether HMI supports driver distraction menu
+ * limits
+ *
+ * @param supported Indicates whether driver distraction menu limits is
+ * supported by HMI
+ */
+ virtual void set_driver_distraction_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves whether HMI supports driver distraction menu limits
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool driver_distraction_supported() const = 0;
+
+ /*
* @brief Interface used to store information regarding
* the navigation "System Capability"
* @param navigation_capability contains information related
@@ -466,6 +482,12 @@ class HMICapabilities {
*/
virtual const smart_objects::SmartObjectSPtr rc_capability() const = 0;
+ virtual void set_driver_distraction_capability(
+ const smart_objects::SmartObject& driver_distraction_capability) = 0;
+
+ virtual const smart_objects::SmartObjectSPtr driver_distraction_capability()
+ const = 0;
+
/**
* @brief Sets available SeatLocation capabilities for further usage by
* RC functionality
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index 53d0049d23..9610d36b8e 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -79,6 +79,12 @@
</element>
</enum>
+<enum name="CapacityUnit">
+ <element name="LITERS" />
+ <element name="KILOWATTHOURS" />
+ <element name="KILOGRAMS" />
+</enum>
+
<enum name="PredefinedWindows">
<element name="DEFAULT_WINDOW" value="0">
<description>The default window is a main window pre-created on behalf of the app.</description>
@@ -859,14 +865,6 @@
</element>
</enum>
-<struct name="FuelRange">
- <param name="type" type="Common.FuelType" mandatory="false"/>
- <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
- <description>
- The estimate range in KM the vehicle can travel based on fuel level and consumption.
- </description>
- </param>
-</struct>
<enum name="ComponentVolumeStatus">
<description>The volume status of a vehicle component.</description>
@@ -890,6 +888,27 @@
</element>
</enum>
+<struct name="FuelRange">
+ <param name="type" type="Common.FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+ <param name="level" type="Float" minvalue="-6" maxvalue="1000000" mandatory="false">
+ <description>The relative remaining capacity of this fuel type (percentage).</description>
+ </param>
+ <param name="levelState" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="capacity" type="Float" minvalue="0" maxvalue="1000000" mandatory="false">
+ <description>The absolute capacity of this fuel type.</description>
+ </param>
+ <param name="capacityUnit" type="Common.CapacityUnit" mandatory="false">
+ <description>The unit of the capacity of this fuel type such as liters for gasoline or kWh for batteries.</description>
+ </param>
+</struct>
+
<enum name="TPMS">
<element name="UNKNOWN">
<description>If set the status of the tire is not known.</description>
@@ -929,6 +948,7 @@
<description>No gear</description>
</element>
<element name="DRIVE">
+ <description>Regular Drive mode</description>
</element>
<element name="SPORT">
<description>Drive Sport mode</description>
@@ -952,12 +972,44 @@
</element>
<element name="EIGHTH">
</element>
+ <element name="NINTH">
+ </element>
+ <element name="TENTH">
+ </element>
<element name="UNKNOWN">
</element>
<element name="FAULT">
</element>
</enum>
+<enum name="TransmissionType">
+ <description>Type of transmission used in the vehicle.</description>
+ <element name="MANUAL">
+ <description>Manual transmission.</description>
+ </element>
+ <element name="AUTOMATIC">
+ <description>Automatic transmission.</description>
+ </element>
+ <element name="SEMI_AUTOMATIC">
+ <description>Semi automatic transmission.</description>
+ </element>
+ <element name="DUAL_CLUTCH">
+ <description>Dual clutch transmission.</description>
+ </element>
+ <element name="CONTINUOUSLY_VARIABLE">
+ <description>Continuously variable transmission(CVT).</description>
+ </element>
+ <element name="INFINITELY_VARIABLE">
+ <description>Infinitely variable transmission.</description>
+ </element>
+ <element name="ELECTRIC_VARIABLE">
+ <description>Electric variable transmission.</description>
+ </element>
+ <element name="DIRECT_DRIVE">
+ <description>Direct drive between engine and wheels.</description>
+ </element>
+</enum>
+
<enum name="VehicleDataEventStatus">
<description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
<element name="NO_EVENT" internal_name="VDES_NO_EVENT">
@@ -1141,6 +1193,7 @@
<element name="VEHICLEDATA_FUELCONSUMPTION" />
<element name="VEHICLEDATA_EXTERNTEMP" />
<element name="VEHICLEDATA_VIN" />
+ <element name="VEHICLEDATA_GEARSTATUS" />
<element name="VEHICLEDATA_PRNDL" />
<element name="VEHICLEDATA_TIREPRESSURE" />
<element name="VEHICLEDATA_ODOMETER" />
@@ -1165,6 +1218,9 @@
<element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
<element name="VEHICLEDATA_CLOUDAPPVEHICLEID" />
<element name="VEHICLEDATA_OEM_CUSTOM_DATA" />
+ <element name="VEHICLEDATA_STABILITYCONTROLSSTATUS" />
+ <element name="VEHICLEDATA_WINDOWSTATUS"/>
+ <element name="VEHICLEDATA_HANDSOFFSTEERING"/>
</enum>
<enum name="WiperStatus">
@@ -1676,6 +1732,21 @@
</param>
</struct>
+<struct name="WindowState">
+ <param name="approximatePosition" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>The approximate percentage that the window is open - 0 being fully closed, 100 being fully open</description>
+ </param>
+ <param name="deviation" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50 and the deviation is 10, then the window's location is somewhere between 40 and 60.</description>
+ </param>
+</struct>
+
+<struct name="WindowStatus">
+ <description>Describes the status of a window of a door/liftgate etc.</description>
+ <param name="location" type="Common.Grid" mandatory="true"/>
+ <param name="state" type="Common.WindowState" mandatory="true"/>
+</struct>
+
<struct name="ModuleInfo">
<description>Information about a RC module</description>
<param name="moduleId" type="String" maxlength="100" mandatory="true">
@@ -2820,7 +2891,7 @@
<struct name="MenuParams">
<param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
<description>unique ID of the sub menu, the command must be added to.</description>
- <description>If not provided, the command must be added to the top level of the in application menu.</description>
+ <description>If not provided or 0, the command must be added to the top level of the in application menu.</description>
</param>
<param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
<description>Position within the items that are at the top level of the in application menu.</description>
@@ -3224,6 +3295,15 @@
</param>
</struct>
+<struct name="StabilityControlsStatus">
+ <param name="escSystem" type="Common.VehicleDataStatus" mandatory="false">
+ <description>true if vehicle stability control is ON, else false</description>
+ </param>
+ <param name="trailerSwayControl" type="Common.VehicleDataStatus" mandatory="false">
+ <description>true if vehicle trailer sway control is ON, else false</description>
+ </param>
+</struct>
+
<struct name="BodyInformation">
<param name="parkBrakeActive" type="Boolean" mandatory="true">
<description>Must be true if the park brake is active</description>
@@ -3572,6 +3652,15 @@
</param>
</struct>
+ <struct name="DriverDistractionCapability">
+ <param name="menuLength" type="Integer" mandatory="false">
+ <description>The number of items allowed in a Choice Set or Command menu while the driver is distracted</description>
+ </param>
+ <param name="subMenuDepth" type="Integer" minvalue="1" mandatory="false">
+ <description>The depth of submenus allowed when the driver is distracted. e.g. 3 == top level menu -> submenu -> submenu; 1 == top level menu only</description>
+ </param>
+ </struct>
+
<struct name="SystemCapabilities">
<param name="navigationCapability" type="NavigationCapability" mandatory="false">
</param>
@@ -3579,6 +3668,9 @@
</param>
<param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
</param>
+ <param name="driverDistractionCapability" type="DriverDistractionCapability" mandatory="false">
+ <description>Describes capabilities when the driver is distracted</description>
+ </param>
</struct>
<struct name="RemoteControlCapabilities">
@@ -4104,6 +4196,7 @@
<element name="APP_SERVICES" />
<element name="SEAT_LOCATION"/>
<element name="DISPLAYS"/>
+ <element name="DRIVER_DISTRACTION" />
</enum>
<struct name="SystemCapability">
@@ -4137,6 +4230,9 @@
<param name="seatLocationCapability" type="SeatLocationCapability" mandatory="false">
<description>Contains information about the locations of each seat</description>
</param>
+ <param name="driverDistractionCapability" type="DriverDistractionCapability" mandatory="false" since="6.0">
+ <description>Describes capabilities when the driver is distracted</description>
+ </param>
</struct>
<enum name="HybridAppPreference">
@@ -4174,6 +4270,18 @@
</param>
</struct>
+ <struct name="GearStatus">
+ <param name="userSelectedGear" type="Common.PRNDL" mandatory="false">
+ <description>Gear position selected by the user i.e. Park, Drive, Reverse</description>
+ </param>
+ <param name="actualGear" type="Common.PRNDL" mandatory="false">
+ <description>Actual Gear in use by the transmission</description>
+ </param>
+ <param name="transmissionType" type="Common.TransmissionType" mandatory="false">
+ <description>Tells the transmission type</description>
+ </param>
+ </struct>
+
</interface>
<interface name="Buttons" version="1.3.0" date="2017-07-18">
@@ -4494,7 +4602,7 @@
This parameter is filled for supporting OEM proprietary data exchanges.
</description>
</param>
- <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
+ <param name="url" type="String" minlength="1" mandatory="false">
<description>Optional array of URL(s) for HTTP requests.</description>
</param>
<param name="fileType" type="Common.FileType" mandatory="false">
@@ -5253,7 +5361,7 @@
<description>ID of the sub menu to be added. Unique for the application.</description>
</param>
<param name="menuParams" type="Common.MenuParams" mandatory="true">
- <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
+ <description>Position, parentID, and name of menu to be added.</description>
</param>
<param name="menuIcon" type="Common.Image" mandatory="false">
<description>The image field for AddSubMenu</description>
@@ -5845,7 +5953,7 @@
</function>
<function name="StartStream" messagetype="request">
<description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <param name="url" type="String" minlength="21" mandatory="true">
<description>URL that HMI start playing.</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -5864,7 +5972,7 @@
</function>
<function name="StartAudioStream" messagetype="request">
<description>Request from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <param name="url" type="String" minlength="21" mandatory="true">
<description>URL that HMI start playing.</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -6030,16 +6138,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Boolean" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
@@ -6047,8 +6158,11 @@
<param name="turnSignal" type="Boolean" mandatory="false">
<description>See TurnSignal</description>
</param>
+ <param name="gearStatus" type="Boolean" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
@@ -6092,6 +6206,15 @@
<param name="cloudAppVehicleID" type="Boolean" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Boolean" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Boolean" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6123,16 +6246,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius.</description>
@@ -6140,8 +6266,11 @@
<param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
<description>See TurnSignal</description>
</param>
+ <param name="gearStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
<description>See TireStatus</description>
@@ -6185,6 +6314,15 @@
<param name="cloudAppVehicleID" type="Common.VehicleDataResult" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Common.VehicleDataResult" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
@@ -6219,16 +6357,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Boolean" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius.</description>
@@ -6236,8 +6377,11 @@
<param name="turnSignal" type="Boolean" mandatory="false">
<description>See TurnSignal</description>
</param>
+ <param name="gearStatus" type="Boolean" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
@@ -6281,6 +6425,15 @@
<param name="cloudAppVehicleID" type="Boolean" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Boolean" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Boolean" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6312,16 +6465,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius</description>
@@ -6329,8 +6485,11 @@
<param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
<description>See TurnSignal</description>
</param>
+ <param name="gearStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
<description>See TireStatus</description>
@@ -6374,6 +6533,15 @@
<param name="cloudAppVehicleID" type="Common.VehicleDataResult" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Common.VehicleDataResult" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
@@ -6406,16 +6574,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Boolean" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
@@ -6426,8 +6597,11 @@
<param name="vin" type="Boolean" mandatory="false">
<description>Vehicle identification number</description>
</param>
+ <param name="gearStatus" type="Boolean" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
@@ -6471,6 +6645,15 @@
<param name="cloudAppVehicleID" type="Boolean" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Boolean" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Boolean" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Boolean" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -6502,16 +6685,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
@@ -6522,8 +6708,11 @@
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number</description>
</param>
+ <param name="gearStatus" type="Common.GearStatus" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Common.TireStatus" mandatory="false">
<description>See TireStatus</description>
@@ -6567,6 +6756,15 @@
<param name="cloudAppVehicleID" type="String" mandatory="false">
<description>Parameter used by cloud apps to identify a head unit</description>
</param>
+ <param name="stabilityControlsStatus" type="Common.StabilityControlsStatus" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Common.WindowStatus" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Boolean" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
@@ -6599,16 +6797,19 @@
<description>The number of revolutions per minute of the engine</description>
</param>
<param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
+ <description>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
+ <description>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange</description>
</param>
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <description>
+ The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle.
+ See struct FuelRange for details.
+ </description>
</param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
@@ -6619,8 +6820,11 @@
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number.</description>
</param>
+ <param name="gearStatus" type="Common.GearStatus" mandatory="false">
+ <description>See GearStatus</description>
+ </param>
<param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
+ <description>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</description>
</param>
<param name="tirePressure" type="Common.TireStatus" mandatory="false">
<description>See TireStatus</description>
@@ -6664,6 +6868,15 @@
<param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="stabilityControlsStatus" type="Common.StabilityControlsStatus" mandatory="false">
+ <description>See StabilityControlsStatus</description>
+ </param>
+ <param name="windowStatus" type="Common.WindowStatus" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>See WindowStatus</description>
+ </param>
+ <param name="handsOffSteering" type="Boolean" mandatory="false">
+ <description>To indicate whether driver hands are off the steering wheel</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
index af7effd97f..7446d3acae 100644
--- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
@@ -40,6 +40,7 @@
<element name="beltStatus" />
<element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
+ <element name="gearStatus" />
<element name="prndl" />
<element name="rpm" />
<element name="steeringWheelAngle" />
@@ -50,6 +51,7 @@
<element name="clusterModeStatus" />
<element name="deviceStatus" />
<element name="emergencyEvent" />
+ <element name="stabilityControlsStatus" />
<element name="eCallInfo" />
<element name="abs_State" />
<element name="turnSignal" />
@@ -57,6 +59,7 @@
<element name="tirePressureValue" />
<element name="tpms" />
<element name="cloudAppVehicleID" />
+ <element name="handsOffSteering" />
</enum>
<enum name="AppHMIType">
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
index 909fd2cb2f..dec76dd96c 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
@@ -2056,7 +2056,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"OnVehicleData" :
@@ -2071,7 +2072,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"SubscribeVehicleData" :
@@ -2086,7 +2088,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"UnsubscribeVehicleData" :
@@ -2101,7 +2104,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
}
},
@@ -2325,7 +2329,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"OnVehicleData" :
@@ -2348,7 +2353,8 @@
"odometer",
"tirePressure",
"vin",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"SubscribeVehicleData" :
@@ -2370,7 +2376,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
},
"UnsubscribeVehicleData" :
@@ -2392,7 +2399,8 @@
"cloudAppVehicleID",
"odometer",
"tirePressure",
- "wiperStatus"
+ "wiperStatus",
+ "stabilityControlsStatus"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
index 3260558e70..85693ff515 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
@@ -2056,7 +2056,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"OnVehicleData" :
@@ -2071,7 +2072,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"SubscribeVehicleData" :
@@ -2086,7 +2088,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"UnsubscribeVehicleData" :
@@ -2101,7 +2104,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
}
},
diff --git a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
index 909fd2cb2f..3855ccd481 100644
--- a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
+++ b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
@@ -2056,7 +2056,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"OnVehicleData" :
@@ -2071,7 +2072,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"SubscribeVehicleData" :
@@ -2086,7 +2088,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"UnsubscribeVehicleData" :
@@ -2101,7 +2104,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
}
},
diff --git a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
index 3260558e70..85693ff515 100644
--- a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
+++ b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
@@ -2056,7 +2056,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"OnVehicleData" :
@@ -2071,7 +2072,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"SubscribeVehicleData" :
@@ -2086,7 +2088,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
},
"UnsubscribeVehicleData" :
@@ -2101,7 +2104,8 @@
"myKey",
"prndl",
"rpm",
- "steeringWheelAngle"
+ "steeringWheelAngle",
+ "handsOffSteering"
]
}
},