summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/message_helper/message_helper.cc
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2019-03-07 22:27:16 -0500
committerGitHub <noreply@github.com>2019-03-07 22:27:16 -0500
commitf8e92350ef0dc3b807ed9e5a2a97cf87b77d975c (patch)
tree3093c515daf1fabb8b78d95a3233de70a2c1f8b6 /src/components/application_manager/src/message_helper/message_helper.cc
parent7c8c299260ca5411c62bc5e0c315a62a51c5526f (diff)
parent3da1fc5cd3a1873400ea28cb9977926ffa56e34c (diff)
downloadsdl_core-f8e92350ef0dc3b807ed9e5a2a97cf87b77d975c.tar.gz
Merge pull request #2832 from smartdevicelink/feature/cloud_app_transport
Cloud app transport adapter implementation
Diffstat (limited to 'src/components/application_manager/src/message_helper/message_helper.cc')
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc57
1 files changed, 55 insertions, 2 deletions
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 d2f338c3ce..cc291bbfe3 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -176,6 +176,8 @@ std::pair<std::string,
mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
std::make_pair(strings::fuel_range,
mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
+ std::make_pair(strings::cloud_app_vehicle_id,
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLOUDAPPVEHICLEID),
std::make_pair(strings::external_temp,
mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
std::make_pair(strings::turn_signal,
@@ -1551,15 +1553,20 @@ bool MessageHelper::CreateHMIApplicationStruct(
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
message[strings::app_name] = app->name();
message[strings::app_id] = app->hmi_app_id();
+
+ const std::string policy_app_id = app->policy_app_id();
+ message[hmi_response::policy_app_id] = policy_app_id;
+
const std::string icon_path = app->app_icon_path();
- if (!icon_path.empty()) {
+
+ if (file_system::FileExists(app->app_icon_path())) {
message[strings::icon] = icon_path;
}
if (app->IsRegistered()) {
message[strings::hmi_display_language_desired] = app->ui_language();
message[strings::is_media_application] = app->is_media_application();
} else {
- message[strings::greyOut] = app->is_greyed_out();
+ message[strings::grey_out] = app->is_greyed_out();
}
if (app->tts_name() && !app->tts_name()->empty()) {
message[json::ttsName] = *(app->tts_name());
@@ -1575,6 +1582,46 @@ bool MessageHelper::CreateHMIApplicationStruct(
message[strings::app_type] = *app_types;
}
+ const policy::RequestType::State app_request_types_state =
+ policy_handler.GetAppRequestTypeState(policy_app_id);
+ if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
+ const auto request_types = policy_handler.GetAppRequestTypes(policy_app_id);
+ message[strings::request_type] =
+ SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject& request_types_array =
+ message[strings::request_type];
+
+ size_t index = 0;
+ for (auto it : request_types) {
+ request_types_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestType::State::EMPTY == app_request_types_state) {
+ message[strings::request_type] =
+ SmartObject(smart_objects::SmartType_Array);
+ }
+
+ const policy::RequestSubType::State app_request_subtypes_state =
+ policy_handler.GetAppRequestSubTypeState(policy_app_id);
+ if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) {
+ const auto request_subtypes =
+ policy_handler.GetAppRequestSubTypes(policy_app_id);
+ message[strings::request_subtype] =
+ SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject& request_subtypes_array =
+ message[strings::request_subtype];
+
+ size_t index = 0;
+ for (auto it : request_subtypes) {
+ request_subtypes_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestSubType::State::EMPTY ==
+ app_request_subtypes_state) {
+ message[strings::request_subtype] =
+ SmartObject(smart_objects::SmartType_Array);
+ }
+
if (day_color_scheme) {
message[strings::day_color_scheme] = *day_color_scheme;
}
@@ -1601,6 +1648,12 @@ bool MessageHelper::CreateHMIApplicationStruct(
&secondary_device_info);
}
+ message[strings::is_cloud_application] = app->is_cloud_app();
+ if (app->is_cloud_app()) {
+ message[strings::cloud_connection_status] =
+ app_mngr.GetCloudAppConnectionStatus(app);
+ }
+
return true;
}