APL should be extended to handle receiving Alexa Presentation RenderDocument
and ExecuteCommands
directives from AVS. These directives contain metadata for rendering or operating on display cards for devices with GUI support. For more information about Alexa Presentation Language (APL) see the interface overview: https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/understand-apl.html
◆ getVisualContext()
String com.amazon.aace.apl.APL.getVisualContext |
( |
| ) |
|
Retrieve the visual context from the platform implementation.
- Returns
- the current VisualContext payload.
◆ renderDocument()
void com.amazon.aace.apl.APL.renderDocument |
( |
String |
jsonPayload, |
|
|
String |
token, |
|
|
String |
windowId |
|
) |
| |
Notifies the platform implementation that a RenderDocument
directive has been received. Once called, the client should render the document based on the APL specification in the payload in structured JSON format.
- Note
- The payload may contain customer sensitive information and should be used with utmost care. Failure to do so may result in exposing or mishandling of customer data.
- Parameters
-
[in] | jsonPayload | The payload of the Alexa.Presentation.APL.RenderDocument directive which follows the APL specification. |
[in] | token | The APL presentation token associated with this payload. |
[in] | windowId | The target windowId. |
◆ clearDocument()
void com.amazon.aace.apl.APL.clearDocument |
( |
| ) |
|
Notifies the platform implementation when the client should clear the APL display card. Once the card is cleared, the platform implementation should call clearCard().
◆ executeCommands()
void com.amazon.aace.apl.APL.executeCommands |
( |
String |
jsonPayload, |
|
|
String |
token |
|
) |
| |
Notifies the platform implementation that an ExecuteCommands directive has been received.
- Parameters
-
[in] | jsonPayload | The payload of the Alexa.Presentation.APL.ExecuteCommands directive in structured JSON format. |
[in] | token | Directive token used to bind result processing. |
◆ interruptCommandSequence()
void com.amazon.aace.apl.APL.interruptCommandSequence |
( |
| ) |
|
Notifies the platform implementation that a command execution sequence should be interrupted.
◆ clearCard()
final void com.amazon.aace.apl.APL.clearCard |
( |
| ) |
|
|
protected |
Notifies the Engine to clear the card from the screen and release any focus being held.
◆ clearAllExecuteCommands()
final void com.amazon.aace.apl.APL.clearAllExecuteCommands |
( |
| ) |
|
|
protected |
Notifies the Engine to clear all pending ExecuteCommands directives and mark them as failed.
◆ sendUserEvent()
final void com.amazon.aace.apl.APL.sendUserEvent |
( |
String |
payload | ) |
|
|
protected |
Notifies the Engine to send UserEvent
to AVS.
- Parameters
-
[in] | payload | The UserEvent event payload. The caller of this function is responsible to pass the payload as it defined by AVS. |
◆ setAPLMaxVersion()
final void com.amazon.aace.apl.APL.setAPLMaxVersion |
( |
String |
aplMaxVersion | ) |
|
|
protected |
Set the APL version supported by the runtime component.
- Parameters
-
[in] | aplMaxVersion | The APL version supported. |
◆ setDocumentIdleTimeout()
final void com.amazon.aace.apl.APL.setDocumentIdleTimeout |
( |
long |
documentIdleTimeout | ) |
|
|
protected |
Set a custom document idle timeout.
- Parameters
-
[in] | documentIdleTimeout | The timeout in milliseconds. |
- Note
- Will be reset for every directive received from AVS.
◆ renderDocumentResult()
final void com.amazon.aace.apl.APL.renderDocumentResult |
( |
String |
token, |
|
|
boolean |
result, |
|
|
String |
error |
|
) |
| |
|
protected |
Notifies the Engine with the result of a renderDocument
notification.
- Parameters
-
[in] | token | The document presentation token. |
[in] | result | Rendering result (true on executed, false on exception). |
[in] | error | Error message provided in case result is false. |
◆ executeCommandsResult()
final void com.amazon.aace.apl.APL.executeCommandsResult |
( |
String |
token, |
|
|
boolean |
result, |
|
|
String |
error |
|
) |
| |
|
protected |
Notifies the Engine with the result of an executeCommands
notification.
- Parameters
-
[in] | token | The document presentation token. |
[in] | result | Rendering result (true on executed, false on exception). |
[in] | error | Error message provided in case result is false. |
◆ processActivityEvent()
final void com.amazon.aace.apl.APL.processActivityEvent |
( |
String |
token, |
|
|
ActivityEvent |
event |
|
) |
| |
|
protected |
Notifies the Engine of an activity change event.
- Parameters
-
[in] | source | The source of the activity event. |
[in] | event | The activity change event. |
Alexa Auto SDK 2.3.1 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0