diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c638651c..19fe9866e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,132 @@
# Change Log
___
+## v3.2.0 released on 2021-05-19
+
+### Enhancements
+* Added the `DeviceSetup` platform interface that handles events and directives related to device setup during or after an out-of-the-box experience (OOBE). After the user login, Alexa is informed that device setup is complete and starts the on-boarding experience, for example, by starting a short first-time conversation. For more information, see the Alexa module README for [C++](./modules/alexa/README.md) or [Android](./platforms/android/modules/alexa/README.md).
+
+* Added support in the Connectivity module to provide the network identifier from the vehicle to Alexa, which enables automakers to offer full connectivity plans to customers. For connectivity status, the module supports sending the version of the terms and conditions through a field called `termsVersion`. Also, the `termsStatus` field accepts `DEFERRED`, which means Alexa can remind users to respond to the terms and conditions at a later time.
+
+* Added the Mobile Authorization extension, which enables applications running on the vehicle's head unit to simplify the login experience. To log in to Alexa, the user uses the Alexa mobile app on a paired smartphone, instead of opening a web browser and entering a code.
+
+* Added the Bluetooth extension, which allows the Alexa Auto SDK to connect to devices through the Bluetooth Classic or Bluetooth Low Energy (BLE) protocol.
+
+* Added the Geolocation extension, which provides geolocation consent support. The user can grant consent to location sharing with Alexa from your application.
+
+* Added the `locationServiceAccessChanged(LocationServiceAccess access)` API in the `LocationProvider` interface, which allows the Engine not to query the device location when the location service access is turned off on the device.
+
+* Added the APL Render module, which enables APL rendering capabilities in an Android application.
+ >**Note:** This module is for you to experiment with APL document rendering on an automotive device. Do not use the module to render APL documents in a production vehicle.
+
+* Added support in the Address Book module for a phonetic field. The phonetic field is required for resolving the name of a contact or navigation favorite if the name uses Kanji characters in Japanese.
+
+* Updated the Docker container for the Auto SDK builder script to use OpenSSL 1.1.1k by default. Added an environment variable for you to change the OpenSSL version, if desired. For information about the OpenSSL version, see the [Builder README](./builder/README.md#builder-setup-in-a-docker-environment).
+
+* Updated the Auto SDK to use AVS Device SDK Version 1.22.0. For information about the AVS Device SDK, see the [AVS Device SDK Release Notes](https://developer.amazon.com/en-US/docs/alexa/avs-device-sdk/release-notes.html#version-1220).
+
+* Enhancements for AACS:
+
+ * Added AACS instrumentation, which enables you to better understand the interactions between your application and AACS. Through instrumentation, you log Alexa Auto Service Bridge (AASB) messages to a file, which you can review for debugging purposes. For information about AACS instrumentation, see the [README](./platforms/android/alexa-auto-client-service/android-service/service/src/debug/java/com/amazon/alexaautoclientservice/README.md).
+
+ * Added an app component called `alexa-auto-telephony`, which enables you to pre-integrate Alexa Phone Call Controller functionalities with Android Telephony.
+
+ * Added an app component called `alexa-auto-contacts` to enable AACS Core Service to fetch contact information from the vehicle's head unit and send it to Alexa. The AACS Core Service can also use this library to remove from Alexa the uploaded contact information.
+
+ * Added the AACS AAR, which you can include in your application.
+
+ * The timeout for AASB synchronous messages is now configurable. For information about configuring the timeout, see the [README](./platforms/android/alexa-auto-client-service/android-service/README.md#auto-sdk-modules).
+
+* Enhancements for AACS Sample App:
+
+ * Added support for new features in the AACS Sample App. For example, it includes a menu for the user to select a language if the in-vehicle infotainment (IVI) language is not supported by Alexa, and it supports authorization with Preview Mode.
+
+ * Added support for the Alexa Custom Assistant extension to the Alexa Auto Client Service (AACS) Sample App. The sample app demonstrates how an application can use AACS with this extension. With app components included with the sample app, you can develop an application that handles assistant handoff and displays custom animation for your custom assistant.
+ >**Note:** In order to use Alexa Custom Assistant extension with the AACS Sample App, you must install an extra component in the Auto SDK. [Contact your Amazon Solutions Architect (SA) or Partner Manager](./NEED_HELP.md#requesting-additional-functionality) for details.
+
+* Enhancements for metrics uploading:
+
+ * The Auto SDK emits only registration metrics before user login is complete. Other metrics are emitted after user login.
+
+ * The Device Client Metrics (DCM) extension supports uploading more metrics from the vehicle than in previous versions.
+
+ * The DCM extension supports anonymizing all Auto SDK metrics.
+
+* Enhancements for car control:
+
+ * Added prompt improvements. Alexa can provide a recommendation or ask for clarification after receiving an invalid or ambiguous user request. Suppose a user request targets the wrong mode, setting, or value for an appliance, such as "Alexa, set fan speed to 100", Alexa responds, "Sorry, you can only set the fan between 1 and 10". When the target in a user request is ambiguous, Alexa prompts for more information to determine the exact meaning of the request. For example, when a user says, "Turn on fan" (when the fan's default zone is not set), Alexa responds, "For the driver, the passenger, or the rear?" This feature is supported online and offline.
+
+ * Improved asset management for car control, which enables Alexa to accept utterances only a few seconds after the user logs in. Previously, the user had to wait up to 20 seconds for Alexa to accept utterances.
+
+* Improved the Auto SDK Voice Chrome extension to allow the height and width of the linear voice chrome to be controlled by the parent layout. Previously, the dimensions were fixed.
+
+### Resolved Issues
+* Disabled APL by default in AACS to make sure utterances like "tell me a joke" work correctly without handling APL. If your platform wants to implement APL, see the AACS [Configuration README](./platforms/android/alexa-auto-client-service/android-service/README.md#aacs-module-enablement) to enable it.
+
+* An SMS message can be sent to an Alexa contact correctly. A user request to send an SMS message to an Alexa contact no longer results in an Alexa-to-Alexa message.
+
+* For car control, there is no longer a limit of two Device Serial Numbers (DSN) per account or Customer ID (CID).
+
+* After the AmazonLite Wake Word locale model is switched from the default (en-US) to another locale model (e.g., de-DE), the newly selected locale remains in effect after the user quits and then restarts the application.
+
+* Numeric weather IDs are passed to AVS for the `TemplateRunTime` API, making it easier for you to display weather icons that are consistent with your user interface.
+
+* After the user disconnects the phone, if the user tries to use Alexa to make a call, Alexa responds correctly by reminding the user to connect the phone. Previously, Alexa tried to dial the number.
+
+* After the user pauses on Spotify and presses “Play” to resume, the player starts correctly from the point where the player stops. Previously the player skipped ahead, resuming from an incorrect place.
+
+* `AutoVoiceChromeController` and `StateChangeAnimationScheduler` of the Voice Chrome extension are thread-safe now, preventing the Alexa app from crashing in different scenarios (e.g. when changing to the previous music track).
+
+### Known Issues
+* General
+ * If the "locales" field of the "deviceSettings" node of the Alexa module configuration JSON is not specified, the Engine automatically declares support for the following locale combinations:
+ ["en-US", "es-US"],
+ ["es-US", "en-US"],
+ ["en-IN", "hi-IN"],
+ ["hi-IN", "en-IN"],
+ ["fr-CA", "en-CA"],
+ ["en-CA", "fr-CA"].
+
+ The Engine does not declare support for locale combinations if the "locales" field is assigned an empty value.
+
+ * The `wakewordEnabled` property is not persistent across device reboots. If you use AACS, however, this issue does not occur.
+
+ * For Linux platforms, if your hardware does not use AVX2 instructions, the wake word library initialization causes an illegal instruction error.
+
+* Car Control
+ * If you configure the Auto SDK Engine and connect to Alexa using a set of endpoint configurations, you cannot delete any endpoint in a set in the cloud. For example, after you configure set A with endpoints 1, 2, and 3, if you change your car control configuration during development to set B with endpoints 2, 3, and 4, endpoint 1 from set A remains in the cloud and might interfere with resolving the correct endpoint ID for your utterances. However, any endpoint configurations with matching IDs override previous configurations. For example, the configuration of endpoint 2 in set B replaces endpoint 2 in set A. During development, limit configuration changes to create only supersets of previous endpoint configurations. Work with your Solutions Architect or Partner Manager to produce the correct configuration on the first try.
+
+ * Car control utterances that are variations of supported utterances but do not follow the supported utterance patterns return errors. Examples include “please turn on the light in the car” instead of the supported “turn on the light“, and ”put on the defroster“ or “defrost the windshield” instead of the supported ”turn on the defroster”.
+
+* Communications
+
+ * DTMF utterances that include the letters "A", "B", "C", or "D" (for example "press A" or "dial 3*#B") are ignored.
+
+ * Calling numbers such as 1-800-xxx-xxxx by using utterances such as “Alexa call one eight double oh...” may return unexpected results. Similarly, when you call numbers by using utterances that include "triple," "hundred," and "thousand," or press special characters such as # or * by saying "Alexa press *#", you may experience unexpected results. We recommend that your client application ignore special characters, dots, and non-numeric characters when requesting Alexa to call or press digits.
+
+ * A user playing any skill with extended multi-turn dialogs (such as Jeopardy or Skyrim) cannot use voice to accept or reject incoming Alexa-to-Alexa calls.
+
+* Entertainment
+ * A user playing notifications while music is playing hears the music for a split second between the end of one notification and the start of the next.
+
+ * The word, "line-in," in an utterance is sometimes misinterpreted as "line" or other words. For example, if the user says, "Switch to line-in," the misinterpretation of "line-in" might cause an incorrect response.
+
+ * When an external player authorization is in progress at the exact moment of shutdown, a very rare race condition might occur, causing the Engine to crash.
+
+ * If your Android app displays the NowPlaying Display Card whenever Alexa plays media, the card might be erroneously dismissed. For example, during music playback, if a user invokes Alexa, putting Alexa in LISTENING, THINKING, or SPEAKING state, and then cancels the Alexa session by tapping the Cancel button, the NowPlaying card is dismissed. A media Display Card should not be automatically dismissed in this scenario.
+
+* Authentication
+ * The CBL module uses a backoff when refreshing the access token after expiry. If the internet is disconnected when the refresh is attempted, it could take up to a minute to refresh the token when the internet connection is restored.
+
+* AACS
+
+ * For some platform interface APIs in the Core module, when an application fails to handle a directive, there is no way to report the failure to the Engine. This is because AASB assumes that the application always handles messages correctly. When AASB incorrectly reports how the application handles the message, the Engine state might become inconsistent with the application state. For example, suppose the Engine sends a directive to the application to set the audio volume but the application fails to make the change. AASB does not report the failure to the Engine. As a result, the Engine's and the application's settings become out of sync. The following list shows the affected APIs:
+ * `AudioInput`:
+ * `startAudioInput()`
+ * `AudioOutput`:
+ * `setPosition(int64_t position)`
+ * `volumeChanged(float volume)`
+ * `mutedStateChanged(MutedState state)`
+
## v3.1.0 released on 2020-12-15
### Enhancements
diff --git a/GETSTARTED.md b/GETSTARTED.md
index b41e0570e..eea6c2cda 100644
--- a/GETSTARTED.md
+++ b/GETSTARTED.md
@@ -20,7 +20,7 @@ Follow these steps to get started with the Auto SDK:
2. If you want to use the optional Auto SDK modules, download the modules from the locations listed in [Downloading Optional Extensions](#downloading-optional-extensions).
3. Build the Auto SDK as described in the builder [README](./builder/README.md).
- >**Note:** If your target platform is Android and you want to implement any optional modules (such as wake word support and Alexa Communications), you must use the Android Archive (AAR) files generated by the Auto SDK Builder. Do not use the prebuilt platform .AARs and sample-core AAR available in JCenter; they are for the default Auto SDK modules only.
+ >**Note:** If your target platform is Android and you want to implement any optional modules (such as wake word support and Alexa Communications), you must use the Android Archive (AAR) files generated by the Auto SDK Builder. Do not use the prebuilt platform AARs and sample-core AAR available in the Maven central repository; they are for the default Auto SDK modules only.
4. Install the built package on your device as described in the builder [README](./builder/README.md).
diff --git a/MIGRATION.md b/MIGRATION.md
index 04a8274ea..20c378677 100644
--- a/MIGRATION.md
+++ b/MIGRATION.md
@@ -2,11 +2,14 @@
This guide outlines the changes you need to make to migrate from Auto SDK v2.0 to later versions of the Auto SDK.
->**Note:** If you migrate from a version earlier than v2.3, be sure to read the relevant sections of this guide to understand all changes introduced between your current version and v3.1. The information helps you decide what changes you must include. For example, if you migrate from v2.0, include the changes described in [Migrating from Auto SDK v2.0 to v2.1](#migrating-from-auto-sdk-v20-to-v21), the changes described in [Migrating from Auto SDK v2.1 to v2.2](#migrating-from-auto-sdk-v21-to-v22), and so on, taking into consideration the deprecated or removed features in each version.
+>**Note:** If you migrate from a version earlier than v2.3, be sure to read the relevant sections of this guide to understand all changes introduced between your current version and v3.2. The information helps you decide what changes you must include. For example, if you migrate from v2.0, include the changes described in [Migrating from Auto SDK v2.0 to v2.1](#migrating-from-auto-sdk-v20-to-v21), the changes described in [Migrating from Auto SDK v2.1 to v2.2](#migrating-from-auto-sdk-v21-to-v22), and so on, taking into consideration the deprecated or removed features in each version.
## Table of Contents
+- [Migrating from Auto SDK v3.1.0 to v3.2.0](#migrating-from-auto-sdk-v310-to-v320)
+ - [Using the Alexa Communication Extension](#using-the-alexa-communication-extension)
+ - [Using the Device Client Metrics (DCM) Extension](#using-the-device-client-metrics-dcm-extension)
- [Migrating from Auto SDK v3.0.0 to v3.1.0](#migrating-from-auto-sdk-v300-to-v310)
- [Migrating to the Authorization Platform Interface](#migrating-to-the-authorization-platform-interface)
- [Deprecated Features Removed in Auto SDK v3.0.0](#deprecated-features-removed-in-auto-sdk-v300)
@@ -28,6 +31,21 @@ This guide outlines the changes you need to make to migrate from Auto SDK v2.0 t
- [Car Control Source File Relocation](#car-control-source-file-relocation)
- [Code-Based-Linking (CBL) Handler in the Sample Apps](#code-based-linking-cbl-handler-in-the-sample-apps)
+## Migrating from Auto SDK v3.1.0 to v3.2.0
+This section provides the information you need to migrate from Auto SDK v3.1.0 to Auto SDK 3.2.0.
+
+### Using the Alexa Communication Extension
+The Alexa Comms library in Auto SDK v3.2.0 uses Device Client Metrics (DCM) instead of AWS IoT for uploading metrics. Therefore, remove the `iotCertificateDirPath`, `iotHostAddress`, and `deviceTypeId` fields from the communication configuration file. For information about the configuration file format, see the Alexa Communication extension README.
+
+If you build the Alexa Comms module configuration using the programmatic factory function `AlexaCommsConfiguration::createCommsConfig()` (C++) or `AlexaCommsConfiguration.createCommsConfig()` (Java), remove the parameters that are no longer present in the signature.
+
+### Using the Device Client Metrics (DCM) Extension
+The Device Client Metrics extension in Auto SDK v3.2.0 requires a field called `metricsTag` to be defined in the DCM configuration. The value of `metricsTag` is used for generating a unique identifier for anonymous registration metrics.
+
+>**Note:** You must not use the vehicle identification number (VIN) or device serial number (DSN) as `metricsTag`. For information about how to use this field, see the Device Client Metric extension README.
+
+If you build the DCM module configuration using the programmatic factory function `DCMConfiguration::createDCMConfig()` (C++) or `DCMConfiguration.createDCMConfig()` (Java), add the `metricsTag` parameter as instructed in the API documentation.
+
## Migrating from Auto SDK v3.0.0 to v3.1.0
This section provides the information you need to migrate from Auto SDK v3.0.0 to Auto SDK v3.1.0.
diff --git a/README.md b/README.md
index 31a8d4511..710cdbf5c 100644
--- a/README.md
+++ b/README.md
@@ -1,60 +1,71 @@
# Overview of the Alexa Auto SDK
-The Alexa Auto SDK contains essential client-side software required to integrate Alexa into the automobile. The software includes the source code and function libraries in C++ and Java. The Auto SDK is modular and abstract, providing a runtime engine for your vehicle to communicate with the Alexa service. It also provides interfaces for you to implement platform-specific behavior, such as audio input, media playback, template and state rendering, phone control, and navigation. After you build and install the Auto SDK, you can use the included sample applications, one for C++ and one for Android, to learn about the Auto SDK interfaces and to test interactions before integration.
+The Alexa Auto SDK contains essential client-side software required to integrate Alexa into the automobile. The Auto SDK provides libraries that connect to Alexa and expose C++ and Java interfaces for your vehicle software to implement the platform-specific behavior for audio input, media streaming, calling through a connected phone, turn-by-turn navigation, controlling vehicle features such as heaters and lights, and more. You can use the included sample applications, one for C++ and one for Android, to learn about the Auto SDK interfaces and to test interactions before integration.
## Table of Contents
-- [Auto SDK Architecture and Modules](#auto-sdk-architecture-and-modules)
+- [Auto SDK Architecture](#auto-sdk-architecture)
+- [Auto SDK Modules and Extensions](#auto-sdk-modules-and-extensions)
- [Alexa Auto Client Service (AACS)](#alexa-auto-client-service-aacs)
- [Security Best Practices](#security-best-practices)
- [See Also](#see-also)
-## Auto SDK Architecture and Modules
+## Auto SDK Architecture
-> **Note**: This diagram shows only some of the available platform interfaces.
+The following architecture diagram illustrates a common design used for integrating the Auto SDK into the vehicle software.
-The following sections describe the Auto SDK modules and extensions, which are optional modules.
+The following sections describe the relationships among components in the architecture.
-###  Alexa Auto SDK Engine
+### Auto SDK Engine
+The Engine is a system of components that provide the runtime implementation of the Auto SDK. The main program of your application or background service creates an instance of the Engine and configures the instance, registers platform interface handlers, and manages its lifecycle. When started by the main program, the Engine maintains a connection to Alexa, manages runtime execution states, and provides the underlying implementation of the functionality of the platform interfaces.
-The Auto SDK Engine is the runtime implementation of the Auto SDK. Platform-specific behavior in the Alexa Auto SDK is abstracted into interfaces called "platform interfaces." Modules in the Auto SDK extend the Engine by providing services and defining the runtime behavior for platform interfaces that are registered by the application. The platform interfaces define the API that determines how the application communicates with the Engine.
+### Platform Interfaces
+Platform interfaces are abstract interfaces provided by the Auto SDK for you to implement the platform-specific functionality of the Auto SDK integration. “Platform-specific functionality” refers to components of the integration that interact with the hardware, operating system, underlying software frameworks, or external libraries. Each platform interface defines an API for the application to interact with the Engine for a particular component, such as audio input or location services. The Engine invokes a registered platform interface “handler” when it needs to query data or delegate handling, such as rendering visual elements or placing a phone call, to your custom implementation. The handler invokes the Engine to provide a callback to a request from the Engine or provide a proactive notification of a state change.
-###  Core Module
+### Handlers
+Bridging the Engine and other processes running in the head unit, a handler implements the functionality required by the platform interface it extends. The implementation of a handler may include using an event bus, platform-specific inter-process communication (IPC) mechanisms, direct implementations with system libraries, or deep integrations with existing applications.
-The Core module (for [C++](./modules/core/README.md) or [Android](./platforms/android/modules/core/README.md)) includes the Engine class and platform interfaces. It also provides the infrastructure for audio input and output. The infrastructure is necessary for any modules that provide platform interfaces involving audio (for example, the Alexa module). All modules depend on the Core module, which provides them with logging, location reporting, and network monitoring services.
+## Auto SDK Modules and Extensions
+The Auto SDK is organized into logically related groups of functionality called “modules,” which enable you to select only the features you want to include in your integration. Each module includes “Platform” and “Engine” libraries. The Platform library includes the platform interfaces and configuration options required for a feature, and the Engine library augments the base functionality of the Engine with the underlying implementation of the feature.
-The Auto SDK provides a Java version of each C++ platform interface in the Android platform portion of the SDK. The Java interfaces are built, using the Java Native Interface (JNI), on top of the core C++ interfaces. As a result, Android integrations can use Auto SDK interfaces directly.
+>**Note:** The libraries of each module are written in C++, but building the Auto SDK for an Android target enables an Android version of the modules that provide Java wrappers on the C++ interfaces for easier use.
-###  Alexa Module
+The following sections describe the modules included in the Auto SDK. Modules not downloadable with the Auto SDK from GitHub are available as extensions, which you can obtain with help from your Amazon Solutions Architect (SA) or Partner Manager.
-The Alexa module (for [C++](./modules/alexa/README.md) or [Android](./platforms/android/modules/alexa/README.md)) includes platform interfaces and runtime Engine support for Alexa features in the Auto SDK, including speech input and output, audio output, authorization, Alexa speaker, media playback, equalizer control, template and state rendering, local media sources, alerts, notifications, and Do Not Disturb (DND).
+### Core Module
-###  Navigation Module
+The Core module (for [C++](./modules/core/README.md) or [Android](./platforms/android/modules/core/README.md)) provides the infrastructure for audio input and output, authorization, logging, location reporting, metrics, property management, network monitoring services, local storage, and vehicle information services. The infrastructure is necessary for any module that provides platform interfaces (for example, the Alexa module).
-The Navigation module (for [C++](./modules/navigation/README.md) or [Android](./platforms/android/modules/navigation/README.md)) includes platform interfaces and runtime Engine support for Alexa to interface with the onboard navigation system.
+### Alexa Module
-###  Phone Call Controller Module
+The Alexa module (for [C++](./modules/alexa/README.md) or [Android](./platforms/android/modules/alexa/README.md)) supports Alexa features such as speech input and output, authorization, volume control, media playback, equalizer control, template and state rendering, local media sources, alerts, notifications, and do not disturb.
-The Phone Control module (for [C++](./modules/phone-control/README.md) or [Android](./platforms/android/modules/phonecontrol/README.md)) includes platform interfaces and runtime Engine support for Alexa to interface with the onboard telephony system.
+### Navigation Module
+
+The Navigation module (for [C++](./modules/navigation/README.md) or [Android](./platforms/android/modules/navigation/README.md)) provides support for Alexa to interface with the onboard navigation system.
+
+### Phone Call Controller Module
+
+The Phone Call Controller module (for [C++](./modules/phone-control/README.md) or [Android](./platforms/android/modules/phonecontrol/README.md)) provides support for Alexa to interface with the onboard telephony system.
### Address Book Module
-The Address Book module (for [C++](./modules/address-book/README.md) or [Android](./platforms/android/modules/addressbook/README.md)) includes platform interfaces and runtime Engine support to augment the communications and navigation capabilities of Alexa with user data such as phone contacts and navigation favorites ("home", "work", etc.)
+The Address Book module (for [C++](./modules/address-book/README.md) or [Android](./platforms/android/modules/addressbook/README.md)) augments the communications and navigation capabilities of Alexa with user data such as phone contacts and navigation favorites ("home", "work", etc.).
### Code-Based Linking (CBL) Module
-The CBL module (for [C++](./modules/cbl/README.md) or [Android](./platforms/android/modules/cbl/README.md)) includes platform interfaces and runtime Engine support to implement the CBL mechanism of acquiring Login with Amazon (LWA) access tokens.
+The CBL module (for [C++](./modules/cbl/README.md) or [Android](./platforms/android/modules/cbl/README.md)) implements the CBL mechanism of acquiring Login with Amazon (LWA) access tokens. For information about the CBL mechanism, see the [Code-Based Linking documentation](https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/code-based-linking-other-platforms.html).
### Alexa Presentation Language (APL) Module
-The APL module (for [C++](./modules/apl/README.md) or [Android](./platforms/android/modules/apl/README.md)) includes platform interfaces and runtime Engine support to enable devices with graphical user interface (GUI) support to implement APL directives and events.
+The APL module (for [C++](./modules/apl/README.md) or [Android](./platforms/android/modules/apl/README.md)) enables devices to support a visual Alexa experience.
->**Note:** APL rendering on the Android Sample App requires a component that is available by [request from your Amazon Solutions Architect (SA) or Partner Manager](./NEED_HELP.md#requesting-additional-functionality).
+>**Note:** The [APL Render module](./platforms/android/modules/apl-render/README.md) is provided to enable APL rendering capabilities in an Android application.
### Messaging Module
-The Messaging module (for [C++](./modules/messaging/README.md) or [Android](./platforms/android/modules/messaging/README.md)) includes platform interfaces and runtime Engine support for Short Message Service (SMS) capabilities of Alexa such as sending and reading text messages.
+The Messaging module (for [C++](./modules/messaging/README.md) or [Android](./platforms/android/modules/messaging/README.md)) provides support for Short Message Service (SMS) capabilities of Alexa such as sending and reading text messages.
### Car Control Module
The Car Control module (for [C++](./modules/car-control/README.md) or [Android](./platforms/android/modules/car-control/README.md)) enables your application to build a custom vehicle-control experience that allows the user to voice-control vehicle features using Alexa.
@@ -74,28 +85,38 @@ Wake Word enables hands-free, voice-initiated interactions with Alexa. The Wake
### Alexa Communications Extension
The Alexa Communications extension enables integration with Alexa-to-Alexa calling, Alexa-to-PSTN calling, and messaging capabilities.
+### Alexa Custom Assistant Extension
+The Alexa Custom Assistant extension provides the functionality for toggling the settings of Alexa and the automaker's voice assistant, and notifies the IVI system at runtime about updates to the acting assistant for a specific interaction.
+
+### Bluetooth Extension
+The Bluetooth extension allows the Auto SDK to connect to devices through the Bluetooth Classic or Bluetooth Low Energy (BLE) protocol. Using these protocols, the Auto SDK can offer Bluetooth-based features to users of Android or iOS smartphones.
+
+### Device Client Metrics (DCM) Extension
+The Device Client Metrics (DCM) extension enables logging and uploading Auto SDK metrics to the Amazon cloud. Voice request metrics, for example, include start and end timestamps of user and Alexa speech and user perceived latency (UPL) between the request and Alexa’s response.
+
+### Geolocation Extension
+The Geolocation extension adds geolocation consent support to the Auto SDK, enabling the user to grant consent to location sharing with Alexa from your application.
+
### Local Voice Control (LVC) Extension
-The Local Voice Control (LVC) extension provides car control, communication, navigation, and entertainment functionality, with and without an internet connection. It includes components that run an Alexa endpoint inside the vehicle's head unit. Local Voice Control is currently supported on Linux x86 64-bit, Linux ARM 64-bit, Android x86 64-bit, and Android ARM 64-bit platforms.
+The LVC extension provides car control, communication, navigation, local search, and entertainment functionality, without an internet connection. It includes components that run an Alexa endpoint inside the vehicle's head unit.
#### Local Navigation Module
The Local Navigation module enables you to provide customers with Alexa local search and navigation without WiFi or data plan connectivity.
-### Device Client Metrics (DCM) Extension
-The Device Client Metrics (DCM) extension enables logging and uploading Alexa Auto SDK metrics to the Amazon cloud. Voice request metrics, for example, include start and end timestamps of user and Alexa speech and user perceived latency (UPL) between the request and Alexa’s response. Metrics may be tagged Beta, Gamma, or Prod depending on the vehicle lifecycle. The DCM extension is available for all Linux and Android platforms.
+### Mobile Authorization Extension
+The Mobile Authorization extension enables applications running on the vehicle's head unit to simplify the login experience. To log in to Alexa, the user uses the Alexa mobile app on a paired smartphone instead of opening a web browser and entering a code.
### Voice Chrome for Android Extension
The Voice Chrome extension adds Voice Chrome support to the Auto SDK for Android x86 64-bit and Android ARM 32/64-bit platforms. Voice Chrome provides a consistent set of visual cues representing Alexa attention state across a range of Alexa-enabled devices. The Voice Chrome extension includes a prebuilt Android AAR library for easy integration with your applications, as well as a patch to the Android Sample App that adds the Voice Chrome functionality.
->**Note:** Auto SDK extensions are available by request. Contact your Amazon Solutions Architect (SA) or Partner Manager for more information.
-
## Alexa Auto Client Service (AACS)
-The Auto SDK includes AACS, an APK (Android package) that enables OEMs of Android-based devices to simplify the process of integrating the Auto SDK. After you install, configure, and initialize AACS, it communicates with the applications, providing an interface between the applications and various Alexa functions, such as navigation and car control. For more information about AACS, see the AACS [README](./platforms/android/alexa-auto-client-service/README.md).
+AACS simplifies the process of integrating the Auto SDK in Android-based devices. After you install, configure, and initialize AACS, it communicates with the applications, providing an interface between the applications and various Alexa functions, such as navigation and car control. You can also include AACS as an Android archive (AAR) in the application if you don't want to run AACS as a separate app. For more information about AACS, see the AACS [README](./platforms/android/alexa-auto-client-service/README.md).
AACS requires the Alexa Auto Service Bridge (AASB) extension, which provides a message-based interface to the Auto SDK Engine. For more information about AASB, see the [AASB README](./extensions/aasb/README.md).
## Security Best Practices
-All Alexa products are required to follow the [Security Best Practices for Alexa](https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/avs-security-reqs.html). When building an Alexa experience using the Alexa Auto SDK, additionally adhere to the following security principles:
+All Alexa products are required to follow the [Security Best Practices for Alexa](https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/avs-security-reqs.html). When building an Alexa experience using the Auto SDK, additionally adhere to the following security principles:
* Protect configuration files for the Auto SDK Engine from tampering and inspection.
* Protect configuration parameters, such as those found in Auto SDK Engine configuration files, from tampering and inspection, including but not limited to the following: SQLite database files, Unix Domain Sockets, wake word models, and metrics sink files.
diff --git a/assets/aac_architecture.png b/assets/aac_architecture.png
index 2d832c69c..b2d0725ae 100644
Binary files a/assets/aac_architecture.png and b/assets/aac_architecture.png differ
diff --git a/builder/README.md b/builder/README.md
index bbaf91f95..1096ff284 100644
--- a/builder/README.md
+++ b/builder/README.md
@@ -112,9 +112,9 @@ See [Builder Command Arguments](#builder-command-arguments) for details about th
>**Note:** The first run might take up to an hour to complete while OpenEmbedded generates all necessary toolchains internally.
#### Installing the Built Package on Android Targets
-The output directory contains the .aar file (AAR) for each module and a sample-core.aar file required to generate the Android Sample App. Pre-built default platform AARs for the default Auto SDK modules and the sample-core AAR are also available from the [JCenter repo](https://jcenter.bintray.com/com/amazon/alexa/aace/). You can add these AARs as dependencies of your Android project instead of building the AARs with the Auto SDK Builder.
+The output directory contains the .aar file (AAR) for each module and a sample-core.aar file required to generate the Android Sample App. Pre-built default platform AARs for the default Auto SDK modules and the sample-core AAR are also available from the [Maven central repository](https://repo.maven.apache.org/maven2/com/amazon/alexa/aace/). You can add these AARs as dependencies of your Android project instead of building the AARs with the Auto SDK Builder.
->**Note:** If you want to implement any optional modules (such as wake word support, Alexa Communications, Local Voice Control (LVC), Device Client Metrics (DCM), or Voice Chrome), you must use the AARs generated by the Auto SDK Builder. The prebuilt platform AARs and sample-core AAR available in JCenter are for the default modules only.
+>**Note:** If you want to implement any optional modules (such as wake word support, Alexa Communications, Local Voice Control (LVC), Device Client Metrics (DCM), or Voice Chrome), you must use the AARs generated by the Auto SDK Builder. The prebuilt platform AARs and sample-core AAR available in the Maven central repository are for the default modules only.
#### Installing the Built Package on Linux or QNX Targets
@@ -130,11 +130,15 @@ The `aac-sdk-build` directory contains the following build artifacts:
If you build for the `native` target, you can install these build artifacts directly on your Linux host.
### Building AACS Using the Auto SDK Builder (Local Build Flavor)
-If your platform is Android, you can build the Auto SDK with AACS. When running the builder script, you must specify the `--aacs-android` option. The following example shows how to build the Auto SDK for the `androidarm` target with AACS and the optional Alexa Communications and Local Voice Control modules:
+If your platform is Android, you can build the Auto SDK with AACS. When running the builder script, you must specify the `--aacs-android` option. The following example shows how to build the Auto SDK for the `androidarm` target with AACS:
-`$ ${AAC_SDK_HOME}/builder/build.sh android -t androidarm --aacs-android extensions/extras/alexacomms extensions/extras/local-voice-control`
+`$ ${AAC_SDK_HOME}/builder/build.sh android -t androidarm --aacs-android`
-See [Builder Command Arguments](#builder-command-arguments) for details about the `platform`, `target` and `options` arguments. The builder creates the `builder/deploy/aar`, which contains the AARs, and `builder/deploy/apk`, which contains the AACS APK. With the `-g` option, the command also creates an archive named `aac-sdk-build--dbg.tar.gz`, which contains debug symbols for later GDB use.
+To include AACS in your application, you can build AACS as an AAR. When running the builder script, specify both the `--aacs-android` and `--aacs-aar` options. The following example shows how to build the Auto SDK for the `androidarm` target with AACS as an AAR:
+
+`$ ${AAC_SDK_HOME}/builder/build.sh android -t androidarm --aacs-android --aacs-aar`
+
+See [Builder Command Arguments](#builder-command-arguments) for details about the `platform`, `target` and `options` arguments. In this example, the builder creates `builder/deploy/aar`, which contains the dependency AARs, and `builder/deploy/apk`, which contains the AACS APK. If you build AACS as AAR, you can find it in `builder/deploy/aacs_aar`. With the `-g` option, the command also creates an archive named `aac-sdk-build--dbg.tar.gz`, which contains debug symbols for later GDB use.
>**Note:** You do not need to specify the AASB extension when building the Auto SDK with AACS. The AASB extension is included by default.
@@ -143,13 +147,22 @@ See [Builder Command Arguments](#builder-command-arguments) for details about th
The unsigned version of the AACS APK is in `builder/deploy/apk`. Go to [Signing the AACS APK](#signing-the-aacs-apk) for information about signing the APK.
### Building AACS Using the Pre-built AARs (Remote Build Flavor)
-The AACS Gradle build is configured to use JCenter to always pull the latest release artifacts during compilation. The pre-built platform AARs for the default modules and the AARs required to build AACS are available in the JCenter repo. To run the build, enter the following commands:
+The AACS Gradle build is configured to use Maven Central to always pull the latest release artifacts during compilation. The pre-built platform AARs for the default modules and the AARs required to build AACS are available in the Maven Central repo.
+
+To run the build for AACS APK, enter the following commands:
```
$ cd ${AAC_SDK_HOME}/platforms/android/alexa-auto-client-service/android-service
$ gradle assembleRemoteRelease
```
+To run the build for AACS AAR, enter the following commands:
+
+```
+ $ cd ${AAC_SDK_HOME}/platforms/android/alexa-auto-client-service/android-service
+ $ gradle assembleRemoteRelease aacs_aar
+```
+
#### Signing the AACS APK
To sign the AACS APK, follow these steps:
@@ -223,12 +236,14 @@ Follow these important guidelines:
This error occurs when Docker runs out of memory. By default, Docker is set to use 2 GB of memory, which is sufficient on a host with 2 cores. If your host has more than 2 cores, allocate 6 GB to Docker to resolve this issue.
+* The default OpenSSL version used with Docker is 1.1.1k. To override the default OpenSSL version, which is used for the native build target, specify the version with the environment variable `AAC_OPENSSL_VERSION` before running the build.sh script.
+
Upon first run, the builder builds the Docker image `aac/ubuntu-base:` and creates a dedicated Docker volume `buildervolume` to run the Auto SDK Builder in your Docker environment. This might take up to an hour to complete.
### Additional Setup for Poky Linux Targets
To build a Poky Linux ARM target, make sure you have the appropriate toolchain for your target platform prior to running the Auto SDK Builder. For example, if you are building a Poky Linux ARM target `pokyarm64` on an Ubuntu system, you can download and run the [Poky ARM toolchain](http://downloads.yoctoproject.org/releases/yocto/yocto-2.6.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-aarch64-toolchain-2.6.1.sh).
-Auto SDK Builder uses `/opt/poky/2.6.1` as a root SDK directory by default. You can change this behavior with the `--poky-sdk` option.
+Auto SDK Builder uses `/opt/poky/2.6.1` as a root SDK directory by default. You can change this behavior with the `--pokysdk-path` option.
### Additional Setup for Generic Linux ARM Targets
@@ -313,6 +328,7 @@ $ ${AAC_SDK_HOME}/builder/build.sh linux -t native,pokyarm,pokyarm64
| Android ARMv7a | `android` | `androidarm` |
| Android ARMv8a | `android` | `androidarm64` |
| Android x86-64 | `android` | `androidx86-64` |
+| Android x86 | `android` | `androidx86` |
| QNX AArch64 | `qnx7` | `qnx7arm64` |
| QNX x86-64 | `qnx7` | `qnx7x86-64` |
|
diff --git a/builder/meta-aac-builder/conf/distro/aac.conf b/builder/meta-aac-builder/conf/distro/aac.conf
index 82bca56cc..d058e60c5 100644
--- a/builder/meta-aac-builder/conf/distro/aac.conf
+++ b/builder/meta-aac-builder/conf/distro/aac.conf
@@ -33,8 +33,8 @@ WARN_QA_remove = "useless-rpaths host-user-contaminated"
# Use our pkgconfig logic
INHERIT += "aac-base"
-# Use AVS Device SDK v1.19
-PREFERRED_VERSION_avs-device-sdk ?= "1.19%"
+# Use AVS Device SDK v1.22.0
+PREFERRED_VERSION_avs-device-sdk ?= "1.22.0%"
# Debug build
IMAGE_GEN_DEBUGFS ?= "${@['0', '1'][d.getVar('DEBUG_BUILD') == '1']}"
diff --git a/builder/meta-aac-builder/recipes-connectivity/openssl/openssl_1.1.0%.bbappend b/builder/meta-aac-builder/recipes-connectivity/openssl/openssl_1.1.0%.bbappend
index 14ba47f20..b1fd9e44b 100644
--- a/builder/meta-aac-builder/recipes-connectivity/openssl/openssl_1.1.0%.bbappend
+++ b/builder/meta-aac-builder/recipes-connectivity/openssl/openssl_1.1.0%.bbappend
@@ -22,10 +22,10 @@ do_configure_android() {
no-idea \
no-nextprotoneg \
no-psk \
- no-shared \
no-srp \
no-ssl3 \
no-weak-ssl-ciphers \
+ no-shared \
--prefix=${prefix} \
--openssldir=${libdir}/ssl-1.1 \
--libdir=`basename ${libdir}` \
diff --git a/builder/meta-aac-builder/recipes-core/images/aac-sdk-build.bb b/builder/meta-aac-builder/recipes-core/images/aac-sdk-build.bb
index d494b0de1..8c94d51c6 100644
--- a/builder/meta-aac-builder/recipes-core/images/aac-sdk-build.bb
+++ b/builder/meta-aac-builder/recipes-core/images/aac-sdk-build.bb
@@ -17,4 +17,4 @@ IMAGE_INSTALL += "\
aac-module-phone-control \
aac-module-text-to-speech \
aac-module-text-to-speech-provider \
- "
\ No newline at end of file
+ "
diff --git a/builder/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk-1.19.1/0001-Alexa-Auto-changes-for-v1.19.1-AVS-Device-SDK.patch b/builder/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk-1.19.1/0001-Alexa-Auto-changes-for-v1.19.1-AVS-Device-SDK.patch
deleted file mode 100644
index 274820989..000000000
--- a/builder/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk-1.19.1/0001-Alexa-Auto-changes-for-v1.19.1-AVS-Device-SDK.patch
+++ /dev/null
@@ -1,7085 +0,0 @@
-From 9b8850e797dd9be90a4a0a62ce9a15eaa447c67e Mon Sep 17 00:00:00 2001
-From: Muni Sakkuru
-Date: Tue, 24 Nov 2020 13:34:39 -0800
-Subject: [PATCH 1/1] Alexa Auto changes for v1.19.1 AVS Device SDK
-
-For internal reference: 45cc3665
----
- ACL/src/AVSConnectionManager.cpp | 4 +-
- ADSL/include/ADSL/DirectiveProcessor.h | 15 +-
- ADSL/include/ADSL/DirectiveSequencer.h | 4 +
- ADSL/src/DirectiveProcessor.cpp | 25 +-
- ADSL/src/DirectiveSequencer.cpp | 8 +
- ADSL/test/ADSL/MockDirectiveSequencer.h | 4 +
- AFML/include/AFML/FocusManager.h | 2 +
- AFML/src/FocusManager.cpp | 27 +
- .../AVS/AVSDiscoveryEndpointAttributes.h | 4 +
- .../AVSCommon/AVS/ActionsToDirectiveMapping.h | 88 +++
- .../AVSCommon/AVS/CapabilitySemantics.h | 71 ++
- .../AVSCommon/AVS/DialogUXStateAggregator.h | 45 +-
- .../include/AVSCommon/AVS/EndpointResources.h | 188 +++++
- .../AVS/src/ActionsToDirectiveMapping.cpp | 101 +++
- AVSCommon/AVS/src/CapabilityResources.cpp | 5 +-
- AVSCommon/AVS/src/CapabilitySemantics.cpp | 68 ++
- AVSCommon/AVS/src/DialogUXStateAggregator.cpp | 112 ++-
- AVSCommon/AVS/src/EndpointResources.cpp | 223 ++++++
- .../AVS/test/CapabilityResourcesTest.cpp | 16 +-
- .../AVS/test/CapabilitySemanticsTest.cpp | 223 ++++++
- .../AVS/test/DialogUXStateAggregatorTest.cpp | 24 +-
- AVSCommon/CMakeLists.txt | 5 +
- .../CallStateObserverInterface.h | 17 +-
- .../DirectiveSequencerInterface.h | 4 +
- .../Endpoints/EndpointBuilderInterface.h | 19 +-
- .../SDKInterfaces/FocusManagerInterface.h | 11 +
- .../Messaging/MessagingObserverInterface.h | 129 ++++
- .../ModeControllerAttributeBuilderInterface.h | 13 +-
- .../ModeController/ModeControllerAttributes.h | 36 +-
- ...RangeControllerAttributeBuilderInterface.h | 13 +-
- .../RangeControllerAttributes.h | 34 +-
- ...oggleControllerAttributeBuilderInterface.h | 13 +-
- .../ToggleControllerAttributes.h | 51 +-
- .../SDKInterfaces/MockDirectiveSequencer.h | 4 +
- .../SDKInterfaces/MockFocusManager.h | 1 +
- .../LibcurlUtils/CurlEasyHandleWrapper.h | 35 +-
- .../AVSCommon/Utils/LibcurlUtils/HttpDelete.h | 83 +++
- .../Utils/LibcurlUtils/HttpDeleteInterface.h | 56 ++
- .../AVSCommon/Utils/LibcurlUtils/HttpGet.h | 83 +++
- .../Utils/LibcurlUtils/HttpGetInterface.h | 56 ++
- .../AVSCommon/Utils/Logger/ThreadMoniker.h | 9 +-
- .../AVSCommon/Utils/Threading/Executor.h | 14 +-
- .../include/AVSCommon/Utils/Timing/Timer.h | 7 +-
- .../LibcurlUtils/CurlEasyHandleWrapper.cpp | 58 +-
- .../Utils/src/LibcurlUtils/HttpDelete.cpp | 129 ++++
- AVSCommon/Utils/src/LibcurlUtils/HttpGet.cpp | 129 ++++
- .../LibCurlHttpContentFetcher.cpp | 11 +
- AVSCommon/Utils/src/Logger/ConsoleLogger.cpp | 2 +-
- AVSCommon/Utils/src/Logger/Logger.cpp | 2 +-
- AVSCommon/Utils/src/Logger/ThreadMoniker.cpp | 5 +-
- AVSCommon/Utils/src/Timer.cpp | 6 +-
- .../src/Storage/AVSGatewayManagerStorage.cpp | 6 -
- .../DefaultClient/src/DefaultClient.cpp | 3 +-
- .../CapabilitiesDelegate.h | 3 +
- .../PostConnectCapabilitiesPublisher.h | 9 +-
- .../src/CapabilitiesDelegate.cpp | 6 +-
- .../src/PostConnectCapabilitiesPublisher.cpp | 90 ++-
- .../src/Utils/DiscoveryUtils.cpp | 32 +-
- .../PostConnectCapabilitiesPublisherTest.cpp | 108 ++-
- .../AIP/src/AudioInputProcessor.cpp | 3 +-
- .../AIP/test/AudioInputProcessorTest.cpp | 1 -
- .../include/Alerts/AlertObserverInterface.h | 23 +
- .../include/Alerts/AlertsCapabilityAgent.h | 41 ++
- .../Alerts/include/Alerts/Renderer/Renderer.h | 10 +-
- .../Alerts/src/AlertScheduler.cpp | 3 +
- .../Alerts/src/AlertsCapabilityAgent.cpp | 54 ++
- .../Alerts/src/Renderer/Renderer.cpp | 12 +-
- .../include/AudioPlayer/AudioPlayer.h | 11 +
- .../AudioPlayer/src/AudioPlayer.cpp | 22 +-
- .../AudioPlayer/src/CMakeLists.txt | 7 +-
- .../AudioPlayer/test/AudioPlayerTest.cpp | 34 +
- .../AudioPlayer/test/CMakeLists.txt | 5 +-
- CapabilityAgents/CMakeLists.txt | 1 +
- .../MRM/include/MRM/MRMCapabilityAgent.h | 4 +-
- .../MRM/src/MRMCapabilityAgent.cpp | 6 +-
- CapabilityAgents/Messaging/CMakeLists.txt | 5 +
- .../Messaging/MessagingCapabilityAgent.h | 513 +++++++++++++
- CapabilityAgents/Messaging/src/CMakeLists.txt | 13 +
- .../src/MessagingCapabilityAgent.cpp | 697 ++++++++++++++++++
- .../Messaging/test/CMakeLists.txt | 8 +
- .../ModeControllerAttributeBuilder.h | 8 +-
- .../src/ModeControllerAttributeBuilder.cpp | 17 +-
- .../src/ModeControllerCapabilityAgent.cpp | 8 +-
- .../PlaybackController/PlaybackController.h | 14 +-
- .../src/PlaybackController.cpp | 33 +-
- .../RangeControllerAttributeBuilder.h | 8 +-
- .../src/RangeControllerAttributeBuilder.cpp | 18 +-
- .../src/RangeControllerCapabilityAgent.cpp | 9 +-
- .../src/SpeechSynthesizer.cpp | 27 +-
- .../System/src/ReportStateHandler.cpp | 1 -
- .../System/src/SoftwareInfoSendRequest.cpp | 19 +-
- .../TemplateRuntime/src/TemplateRuntime.cpp | 6 +-
- .../test/TemplateRuntimeTest.cpp | 6 +-
- .../ToggleControllerAttributeBuilder.h | 8 +-
- .../src/ToggleControllerAttributeBuilder.cpp | 17 +-
- .../src/ToggleControllerCapabilityAgent.cpp | 15 +-
- .../Implementation/src/SystemClockDelay.cpp | 2 +-
- CertifiedSender/src/CertifiedSender.cpp | 5 +-
- .../Endpoints/EndpointAttributeValidation.h | 8 +
- Endpoints/include/Endpoints/EndpointBuilder.h | 5 +
- Endpoints/src/EndpointAttributeValidation.cpp | 4 +
- Endpoints/src/EndpointBuilder.cpp | 31 +-
- .../src/MiscDBEqualizerStorage.cpp | 6 -
- .../test/AudioPlayerIntegrationTest.cpp | 19 +
- .../include/SampleApp/InteractionManager.h | 2 +-
- SampleApp/src/InteractionManager.cpp | 2 +-
- Settings/include/Settings/Setting.h | 9 +-
- Settings/src/Types/LocaleWakeWordsSetting.cpp | 18 +-
- .../DoNotDisturbCapabilityAgent.h | 46 +-
- .../src/DoNotDisturbCapabilityAgent.cpp | 9 +-
- 110 files changed, 4136 insertions(+), 266 deletions(-)
- create mode 100644 AVSCommon/AVS/include/AVSCommon/AVS/ActionsToDirectiveMapping.h
- create mode 100644 AVSCommon/AVS/include/AVSCommon/AVS/CapabilitySemantics.h
- create mode 100644 AVSCommon/AVS/include/AVSCommon/AVS/EndpointResources.h
- create mode 100644 AVSCommon/AVS/src/ActionsToDirectiveMapping.cpp
- create mode 100644 AVSCommon/AVS/src/CapabilitySemantics.cpp
- create mode 100644 AVSCommon/AVS/src/EndpointResources.cpp
- create mode 100644 AVSCommon/AVS/test/CapabilitySemanticsTest.cpp
- create mode 100644 AVSCommon/SDKInterfaces/include/AVSCommon/SDKInterfaces/Messaging/MessagingObserverInterface.h
- create mode 100644 AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/HttpDelete.h
- create mode 100644 AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/HttpDeleteInterface.h
- create mode 100644 AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/HttpGet.h
- create mode 100644 AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/HttpGetInterface.h
- create mode 100644 AVSCommon/Utils/src/LibcurlUtils/HttpDelete.cpp
- create mode 100644 AVSCommon/Utils/src/LibcurlUtils/HttpGet.cpp
- create mode 100644 CapabilityAgents/Messaging/CMakeLists.txt
- create mode 100644 CapabilityAgents/Messaging/include/Messaging/MessagingCapabilityAgent.h
- create mode 100644 CapabilityAgents/Messaging/src/CMakeLists.txt
- create mode 100644 CapabilityAgents/Messaging/src/MessagingCapabilityAgent.cpp
- create mode 100644 CapabilityAgents/Messaging/test/CMakeLists.txt
-
-diff --git a/ACL/src/AVSConnectionManager.cpp b/ACL/src/AVSConnectionManager.cpp
-index 8a2c3330..42dfd483 100644
---- a/ACL/src/AVSConnectionManager.cpp
-+++ b/ACL/src/AVSConnectionManager.cpp
-@@ -138,7 +138,9 @@ void AVSConnectionManager::reconnect() {
- }
-
- void AVSConnectionManager::sendMessage(std::shared_ptr request) {
-- m_messageRouter->sendMessage(request);
-+ if (m_messageRouter != nullptr) {
-+ m_messageRouter->sendMessage(request);
-+ }
- }
-
- bool AVSConnectionManager::isConnected() const {
-diff --git a/ADSL/include/ADSL/DirectiveProcessor.h b/ADSL/include/ADSL/DirectiveProcessor.h
-index 40f1074b..e6f6228b 100644
---- a/ADSL/include/ADSL/DirectiveProcessor.h
-+++ b/ADSL/include/ADSL/DirectiveProcessor.h
-@@ -81,7 +81,7 @@ public:
- * @param dialogRequestId The new value for the current @c dialogRequestId.
- */
- void setDialogRequestId(const std::string& dialogRequestId);
--
-+
- /**
- * Returns the @c dialogRequestId currently in use for Directive handling. This may be the empty string if
- * Directives have either experienced errors, or have been cancelled.
-@@ -90,6 +90,10 @@ public:
- */
- std::string getDialogRequestId();
-
-+ void setIsDialogRequestOnline(bool isOnline);
-+
-+ bool isDialogRequestOnline();
-+
- /**
- * Queue an @c AVSDirective for handling by whatever @c DirectiveHandler was registered to handle it.
- *
-@@ -192,6 +196,12 @@ private:
- */
- void processingLoop();
-
-+ void setIsDialogRequestOnlineLocked(bool isOnline);
-+
-+ bool isDialogRequestOnlineLocked();
-+
-+ std::string getDialogRequestIdLocked();
-+
- /**
- * Process (cancel) all the items in @c m_cancelingQueue.
- * @note This method must only be called by threads that have acquired @c m_mutex.
-@@ -293,6 +303,9 @@ private:
- /// Whether or not the @c DirectiveProcessor is enabled.
- bool m_isEnabled;
-
-+ /// Whether the current dialog request is from AVS (online) or AHE (offline)
-+ bool m_isDialogRequestOnline;
-+
- /// The current @c dialogRequestId
- std::string m_dialogRequestId;
-
-diff --git a/ADSL/include/ADSL/DirectiveSequencer.h b/ADSL/include/ADSL/DirectiveSequencer.h
-index 4ee5051b..643809ae 100644
---- a/ADSL/include/ADSL/DirectiveSequencer.h
-+++ b/ADSL/include/ADSL/DirectiveSequencer.h
-@@ -57,6 +57,10 @@ public:
-
- std::string getDialogRequestId() override;
-
-+ void setIsDialogRequestOnline(bool isOnline) override;
-+
-+ bool isDialogRequestOnline() override;
-+
- bool onDirective(std::shared_ptr directive) override;
-
- void disable() override;
-diff --git a/ADSL/src/DirectiveProcessor.cpp b/ADSL/src/DirectiveProcessor.cpp
-index 2ecbf4a9..fcc8c3b6 100644
---- a/ADSL/src/DirectiveProcessor.cpp
-+++ b/ADSL/src/DirectiveProcessor.cpp
-@@ -47,7 +47,8 @@ std::unordered_map Dir
- DirectiveProcessor::DirectiveProcessor(DirectiveRouter* directiveRouter) :
- m_directiveRouter{directiveRouter},
- m_isShuttingDown{false},
-- m_isEnabled{true} {
-+ m_isEnabled{true},
-+ m_isDialogRequestOnline{true} {
- std::lock_guard lock(m_handleMapMutex);
- m_handle = ++m_nextProcessorHandle;
- m_handleMap[m_handle] = this;
-@@ -68,6 +69,16 @@ std::string DirectiveProcessor::getDialogRequestId() {
- return m_dialogRequestId;
- }
-
-+void DirectiveProcessor::setIsDialogRequestOnline(bool isOnline) {
-+ std::lock_guard lock(m_mutex);
-+ setIsDialogRequestOnlineLocked(isOnline);
-+}
-+
-+bool DirectiveProcessor::isDialogRequestOnline() {
-+ std::lock_guard lock(m_mutex);
-+ return isDialogRequestOnlineLocked();
-+}
-+
- bool DirectiveProcessor::onDirective(std::shared_ptr directive) {
- if (!directive) {
- ACSDK_ERROR(LX("onDirectiveFailed").d("action", "ignored").d("reason", "nullptrDirective"));
-@@ -122,6 +133,18 @@ bool DirectiveProcessor::onDirective(std::shared_ptr directive) {
- return true;
- }
-
-+std::string DirectiveProcessor::getDialogRequestIdLocked() {
-+ return m_dialogRequestId;
-+}
-+
-+void DirectiveProcessor::setIsDialogRequestOnlineLocked(bool isOnline) {
-+ m_isDialogRequestOnline = isOnline;
-+}
-+
-+bool DirectiveProcessor::isDialogRequestOnlineLocked() {
-+ return m_isDialogRequestOnline;
-+}
-+
- void DirectiveProcessor::shutdown() {
- {
- std::lock_guard lock(m_handleMapMutex);
-diff --git a/ADSL/src/DirectiveSequencer.cpp b/ADSL/src/DirectiveSequencer.cpp
-index a9045480..763bd30a 100644
---- a/ADSL/src/DirectiveSequencer.cpp
-+++ b/ADSL/src/DirectiveSequencer.cpp
-@@ -67,6 +67,14 @@ std::string DirectiveSequencer::getDialogRequestId() {
- return m_directiveProcessor->getDialogRequestId();
- }
-
-+bool DirectiveSequencer::isDialogRequestOnline() {
-+ return m_directiveProcessor->isDialogRequestOnline();
-+}
-+
-+void DirectiveSequencer::setIsDialogRequestOnline(bool isOnline) {
-+ m_directiveProcessor->setIsDialogRequestOnline(isOnline);
-+}
-+
- bool DirectiveSequencer::onDirective(std::shared_ptr directive) {
- if (!directive) {
- ACSDK_ERROR(LX("onDirectiveFailed").d("action", "ignored").d("reason", "nullptrDirective"));
-diff --git a/ADSL/test/ADSL/MockDirectiveSequencer.h b/ADSL/test/ADSL/MockDirectiveSequencer.h
-index 7773c70d..f0f3f01d 100644
---- a/ADSL/test/ADSL/MockDirectiveSequencer.h
-+++ b/ADSL/test/ADSL/MockDirectiveSequencer.h
-@@ -51,6 +51,10 @@ public:
- return m_dialogRequestId;
- };
-
-+ MOCK_METHOD0(isDialogRequestOnline, bool());
-+
-+ MOCK_METHOD1(setIsDialogRequestOnline, void(bool));
-+
- MOCK_METHOD1(onDirective, bool(std::shared_ptr directive));
-
- MOCK_METHOD0(disable, void());
-diff --git a/AFML/include/AFML/FocusManager.h b/AFML/include/AFML/FocusManager.h
-index cbddf598..c11b195c 100644
---- a/AFML/include/AFML/FocusManager.h
-+++ b/AFML/include/AFML/FocusManager.h
-@@ -133,6 +133,8 @@ public:
- const std::string& channelName,
- std::shared_ptr channelObserver) override;
-
-+ bool releaseChannel(const std::string& channelName) override;
-+
- void stopForegroundActivity() override;
-
- void stopAllActivities() override;
-diff --git a/AFML/src/FocusManager.cpp b/AFML/src/FocusManager.cpp
-index 87ad0398..85a126db 100644
---- a/AFML/src/FocusManager.cpp
-+++ b/AFML/src/FocusManager.cpp
-@@ -122,6 +122,33 @@ std::future FocusManager::releaseChannel(
- return returnValue;
- }
-
-+bool FocusManager::releaseChannel(const std::string& channelName) {
-+ ACSDK_DEBUG1(LX("releaseChannel").d("channelName", channelName));
-+
-+ std::shared_ptr channelToRelease = getChannel(channelName);
-+ if (!channelToRelease) {
-+ ACSDK_ERROR(LX("releaseChannelFailed").d("reason", "channelNotFound").d("channelName", channelName));
-+ return false;
-+ }
-+
-+ auto task = [this, channelToRelease]() {
-+ // Lock here to update internal state which stopForegroundActivity may concurrently access.
-+ std::unique_lock lock(m_mutex);
-+ bool wasForegrounded = isChannelForegroundedLocked(channelToRelease);
-+ m_activeChannels.erase(channelToRelease);
-+ lock.unlock();
-+
-+ setChannelFocus(channelToRelease, FocusState::NONE, MixingBehavior::MUST_STOP);
-+ if (wasForegrounded) {
-+ foregroundHighestPriorityActiveChannel();
-+ }
-+ notifyActivityTracker();
-+ };
-+
-+ m_executor.submit(task);
-+ return true;
-+}
-+
- void FocusManager::stopForegroundActivity() {
- // We lock these variables so that we can correctly capture the currently foregrounded channel and activity.
- std::unique_lock lock(m_mutex);
-diff --git a/AVSCommon/AVS/include/AVSCommon/AVS/AVSDiscoveryEndpointAttributes.h b/AVSCommon/AVS/include/AVSCommon/AVS/AVSDiscoveryEndpointAttributes.h
-index a15c9454..d0c5c681 100644
---- a/AVSCommon/AVS/include/AVSCommon/AVS/AVSDiscoveryEndpointAttributes.h
-+++ b/AVSCommon/AVS/include/AVSCommon/AVS/AVSDiscoveryEndpointAttributes.h
-@@ -20,6 +20,7 @@
- #include
- #include
-
-+#include
- #include
- #include
-
-@@ -123,6 +124,9 @@ struct AVSDiscoveryEndpointAttributes {
- /// A non-empty string identifying the endpoint manufacturer name.
- std::string manufacturerName;
-
-+ /// An EndpointResources object containing friendly names, manufacturer name and description.
-+ EndpointResources endpointResources;
-+
- /// The display categories the device belongs to. This field should contain at least one category. See categories
- /// in this document: https://developer.amazon.com/docs/alexa/device-apis/alexa-discovery.html#display-categories
- /// @note: This value should only include ALEXA_VOICE_ENABLED for the default endpoint.
-diff --git a/AVSCommon/AVS/include/AVSCommon/AVS/ActionsToDirectiveMapping.h b/AVSCommon/AVS/include/AVSCommon/AVS/ActionsToDirectiveMapping.h
-new file mode 100644
-index 00000000..3d915c63
---- /dev/null
-+++ b/AVSCommon/AVS/include/AVSCommon/AVS/ActionsToDirectiveMapping.h
-@@ -0,0 +1,88 @@
-+/*
-+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License").
-+ * You may not use this file except in compliance with the License.
-+ * A copy of the License is located at
-+ *
-+ * http://aws.amazon.com/apache2.0/
-+ *
-+ * or in the "license" file accompanying this file. This file is distributed
-+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
-+ * express or implied. See the License for the specific language governing
-+ * permissions and limitations under the License.
-+ */
-+#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ACTIONSTODIRECTIVEMAPPING_H_
-+#define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ACTIONSTODIRECTIVEMAPPING_H_
-+
-+#include
-+#include
-+
-+namespace alexaClientSDK {
-+namespace avsCommon {
-+namespace avs {
-+
-+/**
-+ * This class represents an "ActionsToDirective" "actionMapping" in a semantic annotation for a capability
-+ * @see https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-discovery.html#semantics-object
-+ */
-+class ActionsToDirectiveMapping {
-+public:
-+ /**
-+ * The constructor.
-+ */
-+ ActionsToDirectiveMapping();
-+
-+ /**
-+ * Adds the specified action to the "actions" array of this action mapping object.
-+ *
-+ * @param action The action to add to the "actions" array
-+ * @return @c true if the action was successfully added, else @c false.
-+ */
-+ bool addAction(const std::string& action);
-+
-+ /**
-+ * Sets the directive used by this action mapping
-+ *
-+ * @param name The name of the directive. Must be a valid directive of the capability interface to which the
-+ * semantics object belongs.
-+ * @param payload The desired payload of the directive used in this action mapping.
-+ * @return @c true if the directive was successfully set, else @c false.
-+ */
-+ bool setDirective(const std::string& name, const std::string& payload = "{}");
-+
-+ /**
-+ * Checks whether this @c ActionsToDirectiveMapping is valid.
-+ *
-+ * @return @c true if valid, else @c false.
-+ */
-+ bool isValid() const;
-+
-+ /**
-+ * Converts this ActionsToDirectiveMapping to a JSON string.
-+ *
-+ * @note This follows the AVS discovery message format.
-+ *
-+ * @return A JSON string of this @c ActionsToDirectiveMapping.
-+ */
-+ std::string toJson() const;
-+
-+private:
-+ /// Indicates an error in construction;
-+ bool m_isValid;
-+
-+ /// List of actions used in this mapping
-+ std::vector m_actions;
-+
-+ /// The name of the directive used in this mapping
-+ std::string m_directiveName;
-+
-+ /// The directive payload used in this mapping
-+ std::string m_directivePayload;
-+};
-+
-+} // namespace avs
-+} // namespace avsCommon
-+} // namespace alexaClientSDK
-+
-+#endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ACTIONSTODIRECTIVEMAPPING_H_
-diff --git a/AVSCommon/AVS/include/AVSCommon/AVS/CapabilitySemantics.h b/AVSCommon/AVS/include/AVSCommon/AVS/CapabilitySemantics.h
-new file mode 100644
-index 00000000..4a39a401
---- /dev/null
-+++ b/AVSCommon/AVS/include/AVSCommon/AVS/CapabilitySemantics.h
-@@ -0,0 +1,71 @@
-+/*
-+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License").
-+ * You may not use this file except in compliance with the License.
-+ * A copy of the License is located at
-+ *
-+ * http://aws.amazon.com/apache2.0/
-+ *
-+ * or in the "license" file accompanying this file. This file is distributed
-+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
-+ * express or implied. See the License for the specific language governing
-+ * permissions and limitations under the License.
-+ */
-+#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSEMANTICS_H_
-+#define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSEMANTICS_H_
-+
-+#include
-+#include
-+
-+#include
-+
-+namespace alexaClientSDK {
-+namespace avsCommon {
-+namespace avs {
-+
-+/**
-+ * This class represents the 'semantics' object of a capability definition.
-+ * @see https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-discovery.html#semantics-object
-+ */
-+class CapabilitySemantics {
-+public:
-+ /**
-+ * The default constructor.
-+ */
-+ CapabilitySemantics() = default;
-+
-+ /**
-+ * Adds an @c ActionsToDirectiveMapping to this semantics definition.
-+ *
-+ * @param mapping The action mapping represented as an @c ActionsToDirectiveMapping.
-+ * @return @c true if adding the mapping was successful, else @c false.
-+ */
-+ bool addActionsToDirectiveMapping(const ActionsToDirectiveMapping& mapping);
-+
-+ /**
-+ * Checks if the @c CapabilitySemantics is valid.
-+ *
-+ * @return @c true if valid, else @c false.
-+ */
-+ bool isValid() const;
-+
-+ /**
-+ * Converts this semantics object to a JSON string.
-+ *
-+ * @note This follows the AVS discovery message format.
-+ *
-+ * @return A JSON string representation of this @c CapabilitySemantics.
-+ */
-+ std::string toJson() const;
-+
-+private:
-+ /// Vector holding the @c ActionsToDirectiveMapping action mappings.
-+ std::vector m_actionMappings;
-+};
-+
-+} // namespace avs
-+} // namespace avsCommon
-+} // namespace alexaClientSDK
-+
-+#endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSEMANTICS_H_
-diff --git a/AVSCommon/AVS/include/AVSCommon/AVS/DialogUXStateAggregator.h b/AVSCommon/AVS/include/AVSCommon/AVS/DialogUXStateAggregator.h
-index cb7ef738..c99726d1 100644
---- a/AVSCommon/AVS/include/AVSCommon/AVS/DialogUXStateAggregator.h
-+++ b/AVSCommon/AVS/include/AVSCommon/AVS/DialogUXStateAggregator.h
-@@ -19,6 +19,7 @@
- #include
- #include
- #include
-+#include
-
- #include "AVSCommon/SDKInterfaces/AudioInputProcessorObserverInterface.h"
- #include
-@@ -41,10 +42,27 @@ namespace avs {
- class DialogUXStateAggregator
- : public sdkInterfaces::AudioInputProcessorObserverInterface
- , public sdkInterfaces::SpeechSynthesizerObserverInterface
-- , public sdkInterfaces::MessageObserverInterface
- , public sdkInterfaces::ConnectionStatusObserverInterface
- , public sdkInterfaces::InteractionModelRequestProcessingObserverInterface {
- public:
-+ /**
-+ * This timeout will be used to avoid going to the IDLE state immediately after receiving a message from AVS so
-+ * that other UX states (such as speech starting) may be processed and propagated before going to IDLE.
-+ */
-+ static constexpr std::chrono::milliseconds SHORT_TIMEOUT_FOR_THINKING_TO_IDLE = std::chrono::milliseconds{200};
-+
-+ /**
-+ * This timeout will be used to time out from the THINKING state in case no messages arrive from AVS so that the
-+ * client may move back to an IDLE state.
-+ */
-+ static constexpr std::chrono::seconds LONG_TIMEOUT_FOR_THINKING_TO_IDLE = std::chrono::seconds{8};
-+
-+ /**
-+ * This timeout will be used to time out from the LISTENING state in case the Request Processing Started (RPS)
-+ * directive is not received from AVS so that the client may move back to an IDLE state.
-+ */
-+ static constexpr std::chrono::seconds LONG_TIMEOUT_FOR_LISTENING_TO_IDLE = std::chrono::seconds{8};
-+
- /**
- * Constructor.
- *
-@@ -55,11 +73,13 @@ public:
- * arrive from AVS.
- * @param timeoutForListeningToIdle This timeout will be used to time out from the LISTENING state in case the
- * Request Processing Started (RPS) directive is not received from AVS.
-+ * @param shortTimeoutForThinkingToIdle This timeout will be used to avoid going to the IDLE state immediately
- */
- DialogUXStateAggregator(
- std::shared_ptr metricRecorder = nullptr,
-- std::chrono::milliseconds timeoutForThinkingToIdle = std::chrono::seconds{8},
-- std::chrono::milliseconds timeoutForListeningToIdle = std::chrono::seconds{8});
-+ std::chrono::milliseconds timeoutForThinkingToIdle = LONG_TIMEOUT_FOR_THINKING_TO_IDLE,
-+ std::chrono::milliseconds timeoutForListeningToIdle = LONG_TIMEOUT_FOR_LISTENING_TO_IDLE,
-+ std::chrono::milliseconds shortTimeoutForThinkingToIdle = SHORT_TIMEOUT_FOR_THINKING_TO_IDLE);
-
- /**
- * Adds an observer to be notified of UX state changes.
-@@ -91,8 +111,6 @@ public:
- const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId mediaSourceId,
- const avsCommon::utils::Optional& mediaPlayerState) override;
-
-- void receive(const std::string& contextId, const std::string& message) override;
--
- /// @name InteractionModelRequestProcessingObserverInterface Functions
- /// @{
- void onRequestProcessingStarted() override;
-@@ -109,14 +127,21 @@ private:
- * Sets the internal state to the new state.
- *
- * @param newState The new Alexa UX state.
-+ * @return Whether the state transition was successful.
- */
-- void setState(sdkInterfaces::DialogUXStateObserverInterface::DialogUXState newState);
-+ bool executeSetState(sdkInterfaces::DialogUXStateObserverInterface::DialogUXState newState);
-
- /**
- * Sets the internal state to @c IDLE if both @c SpeechSynthesizer and @c AudioInputProcessor are in idle state.
- */
- void tryEnterIdleState();
-
-+ /**
-+ * An event has occurred which may transition @c DialogUXStateAggregator out of THINKING mode. This function
-+ * evaluates if the transition is valid and performs the necessary logic to prepare for the transition.
-+ */
-+ void tryExitThinkingState();
-+
- /**
- * Transitions the internal state from THINKING to IDLE.
- */
-@@ -162,6 +187,12 @@ private:
- /// The timeout to be used for transitioning away from the THINKING state in case no messages are received.
- const std::chrono::milliseconds m_timeoutForThinkingToIdle;
-
-+ /**
-+ * This timeout will be used to avoid going to the IDLE state immediately after receiving a message from AVS so
-+ * that other UX states (such as speech starting) may be processed and propagated.
-+ */
-+ const std::chrono::milliseconds m_shortTimeoutForThinkingToIdle;
-+
- /// A timer to transition out of the THINKING state.
- avsCommon::utils::timing::Timer m_thinkingTimeoutTimer;
-
-@@ -170,7 +201,7 @@ private:
-
- /// The timeout to be used for transitioning away form the LISTENING state in case RPS (Request Processing Started)
- /// directive is not received.
-- const std::chrono::microseconds m_timeoutForListeningToIdle;
-+ const std::chrono::milliseconds m_timeoutForListeningToIdle;
-
- /// A timer to transition out of the LISTENING state to IDLE state in case RPS (Request Processing Started)
- /// directive is not received.
-diff --git a/AVSCommon/AVS/include/AVSCommon/AVS/EndpointResources.h b/AVSCommon/AVS/include/AVSCommon/AVS/EndpointResources.h
-new file mode 100644
-index 00000000..1bb0b5bf
---- /dev/null
-+++ b/AVSCommon/AVS/include/AVSCommon/AVS/EndpointResources.h
-@@ -0,0 +1,188 @@
-+/*
-+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License").
-+ * You may not use this file except in compliance with the License.
-+ * A copy of the License is located at
-+ *
-+ * http://aws.amazon.com/apache2.0/
-+ *
-+ * or in the "license" file accompanying this file. This file is distributed
-+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
-+ * express or implied. See the License for the specific language governing
-+ * permissions and limitations under the License.
-+ */
-+#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ENDPOINTRESOURCES_H_
-+#define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ENDPOINTRESOURCES_H_
-+
-+#include
-+#include
-+
-+#include
-+#include
-+
-+namespace alexaClientSDK {
-+namespace avsCommon {
-+namespace avs {
-+
-+class EndpointResources {
-+public:
-+ /**
-+ * The constructor.
-+ */
-+ EndpointResources();
-+
-+ /**
-+ * Function to add friendly name using asset id.
-+ *
-+ * @param assetId The asset id of the friendly name.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addFriendlyNameWithAssetId(const std::string& assetId);
-+
-+ /**
-+ * Function to add friendly name using text value and its locale.
-+ *
-+ * @note When using this method it is recommended to provide the friendly names
-+ * in all the Alexa supported languages. See the class-level link to find the currently
-+ * supported languages.
-+ *
-+ * @note Providing an unsupported locale will result in Discovery failure.
-+ *
-+ * @param text The text of the friendly name. This value can contain up to 128 valid characters.
-+ * @param locale The non-empty locale of the friendly name.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addFriendlyNameWithText(
-+ const std::string& text,
-+ const avsCommon::sdkInterfaces::LocaleAssetsManagerInterface::Locale& locale);
-+
-+ /**
-+ * Function to add manufacturer name using asset id.
-+ *
-+ * @param assetId The asset id of the manufacturer name using @c string.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addManufacturerNameWithAssetId(const std::string& assetId);
-+
-+ /**
-+ * Function to add manufacturer name using text value and its locale.
-+ *
-+ * @note When using this method it is recommended to provide the manufacturer name
-+ * in all the Alexa supported languages. See the class-level link to find the currently
-+ * supported languages.
-+ *
-+ * @note Providing an unsupported locale will result in Discovery failure.
-+ *
-+ * @param text The text of the manufacturer name. This value can contain up to 128 valid characters.
-+ * @param locale The non-empty locale of the manufacturer name.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addManufacturerNameWithText(
-+ const std::string& text,
-+ const avsCommon::sdkInterfaces::LocaleAssetsManagerInterface::Locale& locale);
-+
-+ /**
-+ * Function to add description using asset id.
-+ *
-+ * @param assetId The asset id of the description using @c string.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addDescriptionWithAssetId(const std::string& assetId);
-+
-+ /**
-+ * Function to add description using text value and its locale.
-+ *
-+ * @note When using this method it is recommended to provide the description
-+ * in all the Alexa supported languages. See the class-level link to find the currently
-+ * supported languages.
-+ *
-+ * @note Providing an unsupported locale will result in Discovery failure.
-+ *
-+ * @param text The text of the description. This value can contain up to 128 valid characters.
-+ * @param locale The non-empty locale of the description.
-+ * @return This instance to facilitate setting more information to this EndpointResources.
-+ */
-+ EndpointResources& addDescriptionWithText(
-+ const std::string& text,
-+ const avsCommon::sdkInterfaces::LocaleAssetsManagerInterface::Locale& locale);
-+
-+ /**
-+ * Function to check if the @c EndpointResources is valid.
-+ *
-+ * @return Return @c true if valid, otherwise @c false.
-+ */
-+ bool isValid() const;
-+
-+ /**
-+ * Builds a new EndpointResources with the configured properties.
-+ *
-+ * Build will fail if any attribute is invalid or if a mandatory attribute is missing.
-+ *
-+ * @return A json string representing the EndpointResources; otherwise, an empty string.
-+ */
-+ std::string build() const;
-+
-+private:
-+ /**
-+ * Struct defining a Label, used to describe a resource.
-+ * @see https://developer.amazon.com/docs/device-apis/resources-and-assets.html#capability-resources
-+ */
-+ struct Label {
-+ /// The enum representing the Label type.
-+ enum class LabelType {
-+ /// Asset type.
-+ ASSET,
-+
-+ /// Text type.
-+ TEXT
-+ };
-+
-+ /// The type of the Label.
-+ LabelType type;
-+
-+ /// The value to contain the text or the asset id of the friendly name, manufacturer name or description.
-+ std::string value;
-+
-+ /// The locale of the text, and empty object for asset.
-+ avsCommon::utils::Optional locale;
-+
-+ /**
-+ * @name Comparison operator.
-+ *
-+ * Compare the current Label against a second object.
-+ * Defined for std::find.
-+ *
-+ * @param rhs The object to compare against this.
-+ * @return @c true if the comparison holds; @c false otherwise.
-+ */
-+ /// @{
-+ bool operator==(const Label& rhs) const;
-+ /// @}
-+
-+ /**
-+ * Helper function to convert a Label to a json string.
-+ *
-+ * @return A json string of Label.
-+ */
-+ std::string toJson() const;
-+ };
-+
-+ /// Flag to indicate if there was any error noted.
-+ bool m_isValid = false;
-+
-+ /// Vector holding @c Label for the friendly names.
-+ std::vector