summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin <iCollin@users.noreply.github.com>2019-07-26 13:04:08 -0400
committerGitHub <noreply@github.com>2019-07-26 13:04:08 -0400
commit9a556df9e95a802dd25e97f4e778f6bc4715b48c (patch)
treec8117cc497583819172b8b15290886d226523d50
parent87a6f6204a2742cb679ee7dae22a00567a02d1f8 (diff)
parentfb7a07c489501a6c933075e1c8d591ff2a3ce744 (diff)
downloadsdl_core-9a556df9e95a802dd25e97f4e778f6bc4715b48c.tar.gz
Merge pull request #2965 from smartdevicelink/feature/alert_icon
implement alert icon parameter to alert rpc
-rwxr-xr-xsrc/appMain/hmi_capabilities.json10
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h1
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc17
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc1
-rw-r--r--src/components/interfaces/HMI_API.xml9
-rw-r--r--src/components/interfaces/MOBILE_API.xml13
6 files changed, 50 insertions, 1 deletions
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 481c6d0c6b..71c0b14100 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -242,6 +242,16 @@
"resolutionWidth": 35,
"resolutionHeight": 35
}
+ },
+ {
+ "name": "alertIcon",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 225,
+ "resolutionHeight": 225
+ }
}
],
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 c81f2dd2ea..02b3f1a051 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
@@ -130,6 +130,7 @@ extern const char* initial_text;
extern const char* duration;
extern const char* progress_indicator;
extern const char* alert_type;
+extern const char* alert_icon;
extern const char* play_tone;
extern const char* soft_buttons;
extern const char* soft_button_id;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
index 7173aaf2d0..908f31cd51 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
@@ -350,6 +350,23 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
MessageHelper::SubscribeApplicationToSoftButton(
(*message_)[strings::msg_params], app, function_id());
}
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_icon)) {
+ auto verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::alert_icon],
+ app,
+ application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+
+ msg_params[strings::alert_icon] =
+ (*message_)[strings::msg_params][strings::alert_icon];
+ }
+
// app_id
msg_params[strings::app_id] = app_id;
msg_params[strings::duration] = default_timeout_;
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index cc87128bf0..602f1306d7 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -97,6 +97,7 @@ const char* initial_text = "initialText";
const char* duration = "duration";
const char* progress_indicator = "progressIndicator";
const char* alert_type = "alertType";
+const char* alert_icon = "alertIcon";
const char* play_tone = "playTone";
const char* soft_buttons = "softButtons";
const char* soft_button_id = "softButtonID";
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index e3eb1b6467..decd50c0a1 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -688,6 +688,9 @@
<element name="locationImage">
<description>The optional image of a destination / location</description>
</element>
+ <element name="alertIcon">
+ <description>The image field for Alert</description>
+ </element>
</enum>
<enum name="TextAlignment">
@@ -4640,6 +4643,12 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application requested this RPC.</description>
</param>
+ <param name="alertIcon" type="Common.Image" mandatory="false" >
+ <description>
+ Image to be displayed for the corresponding alert. See Image.
+ If omitted, no (or the default if applicable) icon should be displayed.
+ </description>
+ </param>
</function>
<function name="Alert" messagetype="response">
<param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 05f568af37..78aadbeb73 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -891,7 +891,11 @@
<element name="locationImage" since="4.0">
<description>The optional image of a destination / location</description>
</element>
-
+
+ <element name="alertIcon" since="6.0">
+ <description>The image field for Alert</description>>
+ </element>
+
</enum>
<enum name="CharacterSet" since="1.0">
@@ -4962,6 +4966,13 @@
If omitted on supported displays, the displayed alert shall not have any SoftButtons.
</description>
</param>
+
+ <param name="alertIcon" type="Image" mandatory="false" since="6.0">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon should be displayed.
+ </description>
+ </param>
</function>