public class Alert extends RPCRequest
If connecting to SDL Core v.6.0+, the alert can be canceled programmatically using the `cancelID`. Canceling will not dismiss the alert's speech - only the modal view will be dismissed. On older versions of SDL Core, the alert will persist until the user has interacted with the alert or the specified timeout has elapsed.
HMILevel needs to be FULL or LIMITED.
If the app has been granted function group Notification the HMILevel can also be BACKGROUND| Name | Type | Description | Req. | Notes | Version Available |
|---|---|---|---|---|---|
| alertText1 | String | Text to be displayed in the first field of the display during the Alert. | N | Length is limited to what is indicated in RegisterAppInterface response. If omitted, top display line will be cleared. Text is always centered | SmartDeviceLink 1.0 |
| alertText2 | String | Text to be displayed in the second field of the display during the Alert. | N | Only permitted if HMI supports a second display line. Length is limited to what is indicated in RegisterAppInterface response. If omitted, second display line will be cleared. | SmartDeviceLink 1.0 |
| alertText3 | String | Text to be displayed in the third field of the display during the Alert. | N | Array must have a least one element. | SmartDeviceLink 1.0 |
| ttsChunks | TTSChunk[] | Array of type TTSChunk which, taken together, specify what is to be spoken to the user. | N | Array must have a least one element. | SmartDeviceLink 1.0 |
| duration | Integer | The duration of the displayed portion of the alert, in milliseconds. After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began. | N | Min Value: 3000 Max Value: 10000. If omitted, the default is 5000 milliseconds | SmartDeviceLink 1.0 |
| playTone | Boolean | Specifies whether the alert tone should be played before the TTS (if any) is spoken. | N | If omitted, default is true. | SmartDeviceLink 1.0 |
| softButtons | SoftButton[] | Specifies the soft buttons, the apps wants to use in this alert. | N | If omitted on supported displays, the alert will not have any SoftButton.ArrayMin: 0; ArrayMax: 4 | SmartDeviceLink 1.0 |
| progressIndicator | Boolean | If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc. | N | SmartDeviceLink 1.0 | |
| cancelID | Integer | An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC. | N | SmartDeviceLink 6.0 | |
| alertIcon | Image | Image struct determining whether the icon is static or dynamic. If omitted on supported displays, no (or the default if applicable) icon should be displayed. | N | SmartDeviceLink 6.0.0 |
GetVehicleData,
OnVehicleData,
Show,
Speak| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_ALERT_ICON |
static String |
KEY_ALERT_TEXT_1 |
static String |
KEY_ALERT_TEXT_2 |
static String |
KEY_ALERT_TEXT_3 |
static String |
KEY_CANCEL_ID |
static String |
KEY_DURATION |
static String |
KEY_PLAY_TONE |
static String |
KEY_PROGRESS_INDICATOR |
static String |
KEY_SOFT_BUTTONS |
static String |
KEY_TTS_CHUNKS |
onResponseListenerfunction, KEY_CORRELATION_ID, KEY_FUNCTION_NAME, KEY_NOTIFICATION, KEY_PARAMETERS, KEY_REQUEST, KEY_RESPONSE, messageType, parametersKEY_BULK_DATA, KEY_PROTECTED, store| Constructor and Description |
|---|
Alert()
Constructs a new Alert object
|
Alert(Hashtable<String,Object> hash)
Constructs a new Alert object indicated by the Hashtable parameter
|
| Modifier and Type | Method and Description |
|---|---|
Image |
getAlertIcon()
Gets the image to be shown along with the alert
|
String |
getAlertText1()
Gets the text which is displayed in the first field of the display during the Alert
|
String |
getAlertText2()
Gets the text which is displayed in the second field of the display during the Alert
|
String |
getAlertText3()
Gets the text which is displayed in the third field of the display during the Alert
|
Integer |
getCancelID()
Gets an Integer value representing the cancel ID
|
Integer |
getDuration()
Gets the duration of the displayed portion of the alert, in milliseconds
|
Boolean |
getPlayTone()
Gets a Boolean value representing the alert tone
|
Boolean |
getProgressIndicator()
Gets a Boolean value representing the progress indicator
|
List<SoftButton> |
getSoftButtons()
Gets the SoftButton List object
|
List<TTSChunk> |
getTtsChunks()
Gets TTSChunk[], the Array of type TTSChunk which, taken together,
specify what is to be spoken to the user
|
Alert |
setAlertIcon(Image alertIcon)
Sets the Image
If provided, defines the image to be shown along with the alert
|
Alert |
setAlertText1(String alertText1)
Sets the String to be displayed in the first field of the display during the Alert
|
Alert |
setAlertText2(String alertText2)
Sets the String to be displayed in the second field of the display during the Alert
|
Alert |
setAlertText3(String alertText3)
Sets the String to be displayed in the third field of the display during
the Alert
|
Alert |
setCancelID(Integer cancelID)
Sets the cancel ID
|
Alert |
setDuration(Integer duration)
Sets the duration of the displayed portion of the alert, in milliseconds.
|
Alert |
setPlayTone(Boolean playTone)
Sets whether the alert tone should be played before the TTS (if any) is
spoken
|
Alert |
setProgressIndicator(Boolean progressIndicator)
Sets whether the progress indicator should be shown
|
Alert |
setSoftButtons(List<SoftButton> softButtons)
Sets the SoftButtons
|
Alert |
setTtsChunks(List<TTSChunk> ttsChunks)
Sets array of type TTSChunk which, taken together, specify what is to be
spoken to the user
|
getCorrelationID, getOnRPCResponseListener, setCorrelationID, setOnRPCResponseListenergetBoolean, getDouble, getFloat, getFunctionID, getFunctionName, getInteger, getLong, getMessageType, getObject, getParameters, getString, setFunctionName, setParametersclone, deserializeJSON, equals, format, formatObject, getBulkData, getMessageTypeName, getStore, getStoreValue, getValue, getValueForString, hashCode, hasKey, isPayloadProtected, serializeJSON, serializeJSON, setBulkData, setPayloadProtected, setValuepublic static final String KEY_PLAY_TONE
public static final String KEY_DURATION
public static final String KEY_ALERT_TEXT_1
public static final String KEY_ALERT_TEXT_2
public static final String KEY_ALERT_TEXT_3
public static final String KEY_PROGRESS_INDICATOR
public static final String KEY_TTS_CHUNKS
public static final String KEY_SOFT_BUTTONS
public static final String KEY_CANCEL_ID
public static final String KEY_ALERT_ICON
public String getAlertText1()
public Alert setAlertText1(String alertText1)
alertText1 - a String value representing the text which is displayed in the first field during the Alertpublic String getAlertText2()
public Alert setAlertText2(String alertText2)
alertText2 - a String value representing the text which is displayed in the third field during the Alertpublic String getAlertText3()
public Alert setAlertText3(String alertText3)
alertText3 - a String value representing the text which is displayed in the third field during the Alertpublic List<TTSChunk> getTtsChunks()
public Alert setTtsChunks(List<TTSChunk> ttsChunks)
ttsChunks - Notes: Array must have a least one element
public Integer getDuration()
public Alert setDuration(Integer duration)
duration - -an Integer value representing the duration of the displayed portion of the alert, in millisecondspublic Boolean getPlayTone()
public Alert setPlayTone(Boolean playTone)
playTone - a Boolean value which specifies whether the alert tone should be played before the TTS (if any) is spoken. Notes: If omitted, default is true
public List<SoftButton> getSoftButtons()
public Alert setSoftButtons(List<SoftButton> softButtons)
softButtons - a Listpublic Boolean getProgressIndicator()
public Alert setProgressIndicator(Boolean progressIndicator)
progressIndicator - A Boolean value which specifies whether the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.public Integer getCancelID()
public Alert setCancelID(Integer cancelID)
cancelID - An Integer ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.public Alert setAlertIcon(Image alertIcon)
Sets the Image If provided, defines the image to be shown along with the alert
alertIcon - an Image object representing the Image shown along with the alert. Notes: If omitted on supported displays, no (or the default if applicable) icon will be displayedpublic Image getAlertIcon()
Gets the image to be shown along with the alert