2018-01-12 23:45:42 +00:00
|
|
|
/*
|
2020-04-13 22:56:35 +00:00
|
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2018-01-12 23:45:42 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
#include <queue>
|
|
|
|
#include <sstream>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <AVSCommon/AVS/Attachment/MockAttachmentManager.h>
|
|
|
|
#include <AVSCommon/AVS/IndicatorState.h>
|
|
|
|
#include <AVSCommon/AVS/Initialization/AlexaClientSDKInit.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/Audio/NotificationsAudioFactoryInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/MockExceptionEncounteredSender.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/MockContextManager.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/MockDirectiveSequencer.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/MockDirectiveHandlerResult.h>
|
|
|
|
#include <AVSCommon/Utils/JSON/JSONUtils.h>
|
|
|
|
#include <AVSCommon/Utils/Logger/ConsoleLogger.h>
|
2020-02-19 18:35:26 +00:00
|
|
|
#include <AVSCommon/Utils/Metrics/MockMetricRecorder.h>
|
2018-03-09 00:55:39 +00:00
|
|
|
#include <RegistrationManager/CustomerDataManager.h>
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
#include "Notifications/NotificationsCapabilityAgent.h"
|
|
|
|
#include "Notifications/NotificationIndicator.h"
|
|
|
|
#include "Notifications/NotificationRendererInterface.h"
|
|
|
|
#include "Notifications/NotificationRendererObserverInterface.h"
|
|
|
|
|
|
|
|
namespace alexaClientSDK {
|
|
|
|
namespace capabilityAgents {
|
|
|
|
namespace notifications {
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
using namespace avsCommon::avs;
|
|
|
|
using namespace avsCommon::avs::initialization;
|
|
|
|
using namespace avsCommon::avs::attachment::test;
|
|
|
|
using namespace avsCommon::sdkInterfaces;
|
|
|
|
using namespace avsCommon::sdkInterfaces::audio;
|
|
|
|
using namespace avsCommon::sdkInterfaces::test;
|
|
|
|
using namespace ::testing;
|
|
|
|
|
|
|
|
/// Plenty of time for a test to complete.
|
2020-02-19 18:35:26 +00:00
|
|
|
static std::chrono::milliseconds MY_WAIT_TIMEOUT(1000);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
/// Time to simulate a notification rendering.
|
Version 1.8 alexa-client-sdk
Changes in this update:
Enhancements
Added local stop functionality. This allows a user to stop an active function, such as an alert or timer, by uttering "Alexa, stop" when an Alexa-enabled product is offline.
Alerts in the background now stream in 10 sec intervals, rather than continuously.
Added support for France to the sample app.
friendlyName can now be updated for BlueZ implementations of BlueZBluetoothDevice and BlueZHostController.
Bug Fixes
Fixed an issue where the Bluetooth agent didn't clear user data upon reset, including paired devices and the uuidMapping table.
Fixed MediaPlayer threading issues. Now each instance has it's own glib main loop thread, rather than utilizing the default main context worker thread.
Fixed segmentation fault issues that occurred when certain static initializers needed to be initialized in a certain order, but the order wasn't defined.
Known Issues
The ACL may encounter issues if audio attachments are received but not consumed.
SpeechSynthesizerState currently uses GAINING_FOCUS and LOSING_FOCUS as a workaround for handling intermediate state. These states may be removed in a future release.
The Alexa app doesn't always indicate when a device is successfully connected via Bluetooth.
Connecting a product to streaming media via Bluetooth will sometimes stop media playback within the source application. Resuming playback through the source application or toggling next/previous will correct playback.
When a source device is streaming silence via Bluetooth, the Alexa companion app indicates that audio content is streaming.
The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation is not yet supported.
On some products, interrupted Bluetooth playback may not resume if other content is locally streamed.
On Raspberry Pi, when streaming audio via Bluetooth, sometimes the audio stream stutters.
On Raspberry Pi, BlueALSA must be terminated each time the device boots. See Raspberry Pi Quick Start Guide for more information.
2018-06-27 21:41:15 +00:00
|
|
|
static std::chrono::milliseconds RENDER_TIME(10);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
/// Notifications namespace
|
|
|
|
static const std::string NAMESPACE_NOTIFICATIONS("Notifications");
|
|
|
|
|
|
|
|
/// Name for Notifications SetIndicator directive
|
|
|
|
static const std::string NAME_SET_INDICATOR("SetIndicator");
|
|
|
|
|
|
|
|
/// Name for Notifications ClearIndicator directive
|
|
|
|
static const std::string NAME_CLEAR_INDICATOR("ClearIndicator");
|
|
|
|
|
|
|
|
/// The @c NamespaceAndName to send to the @c ContextManager
|
|
|
|
static const NamespaceAndName NAMESPACE_AND_NAME_INDICATOR_STATE{NAMESPACE_NOTIFICATIONS, "IndicatorState"};
|
|
|
|
|
|
|
|
/// Message Id for testing.
|
|
|
|
static const std::string MESSAGE_ID_TEST("MessageId_Test");
|
|
|
|
static const std::string MESSAGE_ID_TEST2("MessageId_Test2");
|
|
|
|
|
|
|
|
/// Context ID for testing
|
|
|
|
static const std::string CONTEXT_ID_TEST("ContextId_Test");
|
|
|
|
|
|
|
|
/// Test fields for payloads
|
|
|
|
static const std::string ASSET_ID1("assetId1");
|
|
|
|
static const std::string ASSET_ID2("assetId2");
|
|
|
|
static const std::string ASSET_URL1("assetUrl1");
|
|
|
|
static const std::string ASSET_URL2("assetUrl2");
|
|
|
|
|
|
|
|
/// Default "audio" for testing
|
|
|
|
static const std::string DEFAULT_NOTIFICATION_AUDIO{"default notification audio"};
|
|
|
|
|
|
|
|
/// Mocking the json config file
|
|
|
|
// clang-format off
|
|
|
|
static const std::string NOTIFICATIONS_CONFIG_JSON =
|
|
|
|
"{"
|
|
|
|
"\"notifications\":{"
|
|
|
|
"\"databaseFilePath\":\"notificationsUnitTest.db\""
|
|
|
|
"}"
|
|
|
|
"}";
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
/// String to identify log entries originating from this file.
|
|
|
|
static const std::string TAG("NotificationsCapabilityAgentTest");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a LogEntry using this file's TAG and the specified event string.
|
|
|
|
*
|
|
|
|
* @param The event string for this @c LogEntry.
|
|
|
|
*/
|
|
|
|
#define LX(event) alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A test class that acts as a NotificationsAudioFactory.
|
|
|
|
*/
|
|
|
|
class TestNotificationsAudioFactory : public NotificationsAudioFactoryInterface {
|
|
|
|
public:
|
2020-04-13 22:56:35 +00:00
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> notificationDefault()
|
|
|
|
const override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
private:
|
2020-04-13 22:56:35 +00:00
|
|
|
static std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType> defaultNotification() {
|
|
|
|
return std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>(
|
|
|
|
std::unique_ptr<std::istream>(new std::stringstream(DEFAULT_NOTIFICATION_AUDIO)),
|
|
|
|
avsCommon::utils::MediaType::MPEG);
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-04-13 22:56:35 +00:00
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()>
|
|
|
|
TestNotificationsAudioFactory::notificationDefault() const {
|
2018-01-12 23:45:42 +00:00
|
|
|
return defaultNotification;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A test class that acts as a NotificationsObserver.
|
|
|
|
*/
|
|
|
|
class TestNotificationsObserver : public NotificationsObserverInterface {
|
|
|
|
public:
|
|
|
|
TestNotificationsObserver();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for an IndicatorState change.
|
|
|
|
*
|
|
|
|
* @param state The IndicatorState to wait for.
|
|
|
|
* @param timeout The amount of time to wait for the state change.
|
|
|
|
*/
|
|
|
|
bool waitFor(IndicatorState state, std::chrono::milliseconds timeout);
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
/**
|
|
|
|
* Waits for IndicationCount to increase.
|
|
|
|
*
|
|
|
|
* @param count The number of indicator events to wait for.
|
|
|
|
* @param timeout The amount of time to wait for the state change.
|
|
|
|
*/
|
|
|
|
bool waitFor(int count, std::chrono::milliseconds timeout);
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
void onSetIndicator(IndicatorState state) override;
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
void onNotificationReceived() override;
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
private:
|
|
|
|
/// The most recently observed IndicatorState.
|
|
|
|
IndicatorState m_indicatorState;
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
/// The number of notifications received.
|
|
|
|
int m_indicationCount;
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
/// Serializes access to m_conditionVariable.
|
|
|
|
std::mutex m_mutex;
|
|
|
|
|
|
|
|
/// Used to wait for a particular IndicatorState.
|
|
|
|
std::condition_variable m_conditionVariable;
|
|
|
|
};
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
TestNotificationsObserver::TestNotificationsObserver() : m_indicatorState{IndicatorState::OFF}, m_indicationCount{0} {
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsObserver::waitFor(IndicatorState state, std::chrono::milliseconds timeout) {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
return m_conditionVariable.wait_for(lock, timeout, [this, state] { return m_indicatorState == state; });
|
|
|
|
}
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
bool TestNotificationsObserver::waitFor(int count, std::chrono::milliseconds timeout) {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
return m_conditionVariable.wait_for(lock, timeout, [this, count] { return m_indicationCount == count; });
|
|
|
|
}
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
void TestNotificationsObserver::onSetIndicator(IndicatorState state) {
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
ACSDK_INFO(LX("onSetIndicator").d("indicatorState", indicatorStateToInt(state)));
|
2018-01-12 23:45:42 +00:00
|
|
|
std::lock_guard<std::mutex> lock(m_mutex);
|
|
|
|
m_indicatorState = state;
|
|
|
|
m_conditionVariable.notify_all();
|
|
|
|
}
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
void TestNotificationsObserver::onNotificationReceived() {
|
|
|
|
ACSDK_INFO(LX("onNotificationReceived"));
|
|
|
|
std::lock_guard<std::mutex> lock(m_mutex);
|
|
|
|
++m_indicationCount;
|
|
|
|
m_conditionVariable.notify_all();
|
|
|
|
}
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
/**
|
|
|
|
* A test class that acts as NotificationsStorage. This storage is implemented using a std::queue.
|
|
|
|
*/
|
|
|
|
class TestNotificationsStorage : public NotificationsStorageInterface {
|
|
|
|
public:
|
2018-03-09 00:55:39 +00:00
|
|
|
bool createDatabase() override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool open() override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
void close() override;
|
|
|
|
|
|
|
|
bool enqueue(const NotificationIndicator& notificationIndicator) override;
|
|
|
|
|
|
|
|
bool dequeue() override;
|
|
|
|
|
|
|
|
bool peek(NotificationIndicator* notificationIndicator) override;
|
|
|
|
|
|
|
|
bool setIndicatorState(IndicatorState state) override;
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool getIndicatorState(IndicatorState* state) override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool checkForEmptyQueue(bool* empty) override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
bool clearNotificationIndicators() override;
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool getQueueSize(int* size) override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits until the queue is a particular size.
|
|
|
|
*
|
|
|
|
* @param size The size to wait for.
|
|
|
|
* @param timeout How much time to wait before failing.
|
|
|
|
*/
|
2020-02-19 18:35:26 +00:00
|
|
|
bool waitForQueueSizeToBe(size_t size, std::chrono::milliseconds timeout = MY_WAIT_TIMEOUT);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// The underlying NotificationIndicator queue.
|
|
|
|
std::queue<NotificationIndicator> m_notificationQueue;
|
|
|
|
|
|
|
|
/// The currently stored IndicatorState.
|
|
|
|
IndicatorState m_indicatorState;
|
|
|
|
|
|
|
|
/// For waiting on a particular queue size.
|
|
|
|
std::mutex m_mutex;
|
|
|
|
std::condition_variable m_conditionVariable;
|
|
|
|
};
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool TestNotificationsStorage::createDatabase() {
|
2018-01-12 23:45:42 +00:00
|
|
|
if (!setIndicatorState(IndicatorState::OFF)) {
|
|
|
|
ACSDK_ERROR(LX("createTestDatabaseFailed").d("reason", "failed to set default indicator state"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool TestNotificationsStorage::open() {
|
2018-01-12 23:45:42 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestNotificationsStorage::close() {
|
|
|
|
// no-op
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::enqueue(const NotificationIndicator& notificationIndicator) {
|
|
|
|
m_notificationQueue.push(notificationIndicator);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::dequeue() {
|
|
|
|
if (m_notificationQueue.empty()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
m_notificationQueue.pop();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::peek(NotificationIndicator* notificationIndicator) {
|
|
|
|
if (m_notificationQueue.empty() || !notificationIndicator) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*notificationIndicator = m_notificationQueue.front();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::setIndicatorState(IndicatorState state) {
|
|
|
|
m_indicatorState = state;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool TestNotificationsStorage::getIndicatorState(IndicatorState* state) {
|
2018-01-12 23:45:42 +00:00
|
|
|
if (!state) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*state = m_indicatorState;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool TestNotificationsStorage::checkForEmptyQueue(bool* empty) {
|
2018-01-12 23:45:42 +00:00
|
|
|
*empty = m_notificationQueue.empty();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::clearNotificationIndicators() {
|
|
|
|
m_notificationQueue = std::queue<NotificationIndicator>();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
bool TestNotificationsStorage::getQueueSize(int* size) {
|
2018-01-12 23:45:42 +00:00
|
|
|
if (!size) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*size = m_notificationQueue.size();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestNotificationsStorage::waitForQueueSizeToBe(size_t size, std::chrono::milliseconds timeout) {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
return m_conditionVariable.wait_for(lock, timeout, [this, size] { return m_notificationQueue.size() == size; });
|
|
|
|
}
|
|
|
|
|
|
|
|
class MockNotificationRenderer : public NotificationRendererInterface {
|
|
|
|
public:
|
|
|
|
~MockNotificationRenderer();
|
|
|
|
|
|
|
|
MockNotificationRenderer();
|
|
|
|
|
|
|
|
static std::shared_ptr<NiceMock<MockNotificationRenderer>> create() {
|
|
|
|
auto renderer = std::make_shared<NiceMock<MockNotificationRenderer>>();
|
|
|
|
|
|
|
|
// tie the mock methods to mock implementations
|
|
|
|
ON_CALL(*renderer.get(), renderNotificationShim(_, _))
|
|
|
|
.WillByDefault(Invoke(renderer.get(), &MockNotificationRenderer::mockRender));
|
|
|
|
ON_CALL(*renderer.get(), cancelNotificationRenderingShim())
|
|
|
|
.WillByDefault(InvokeWithoutArgs(renderer.get(), &MockNotificationRenderer::mockCancel));
|
|
|
|
|
|
|
|
return renderer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void addObserver(std::shared_ptr<NotificationRendererObserverInterface> observer) override;
|
|
|
|
|
|
|
|
void removeObserver(std::shared_ptr<NotificationRendererObserverInterface> observer) override;
|
|
|
|
|
2020-04-13 22:56:35 +00:00
|
|
|
bool renderNotification(
|
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> audioFactory,
|
|
|
|
const std::string& url) override;
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
bool cancelNotificationRendering() override;
|
|
|
|
|
|
|
|
// create shim methods to prevent compiler from complaining
|
|
|
|
MOCK_METHOD2(
|
|
|
|
renderNotificationShim,
|
2020-04-13 22:56:35 +00:00
|
|
|
bool(
|
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> audioFactory,
|
|
|
|
const std::string& url));
|
2018-01-12 23:45:42 +00:00
|
|
|
MOCK_METHOD0(cancelNotificationRenderingShim, bool());
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A method mocking renderNotification().
|
|
|
|
* This method kicks off two threads (for waitForRenderCall() and waitForRenderCallDone()) and then
|
|
|
|
* notifies those threads. This method may be interrupted by mockCancel().
|
|
|
|
*
|
|
|
|
* Both params are ignored in this mock implementation.
|
|
|
|
*/
|
2020-04-13 22:56:35 +00:00
|
|
|
bool mockRender(
|
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> audioFactory,
|
|
|
|
const std::string& url);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A method mocking cancelRenderingNotification().
|
|
|
|
* This method attempts to sneak in between waitForRenderCall() and waitForRenderCallDone() by
|
|
|
|
* triggering m_renderTrigger before m_finishedRendering has been set to true;
|
|
|
|
*/
|
|
|
|
bool mockCancel();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for mockRender() to set m_startedRendering to true.
|
|
|
|
*/
|
|
|
|
bool waitForRenderCall();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for mockRender() to set m_finishedRendering to true.
|
|
|
|
*/
|
|
|
|
bool waitForRenderCallDone();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for the fulfillment of m_renderStartedPromise, then resets any needed variables.
|
|
|
|
*/
|
2020-02-19 18:35:26 +00:00
|
|
|
bool waitUntilRenderingStarted(std::chrono::milliseconds timeout = MY_WAIT_TIMEOUT);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for the fulfillment of m_renderFinishedPromise, then resets any needed variables.
|
|
|
|
*/
|
2020-02-19 18:35:26 +00:00
|
|
|
bool waitUntilRenderingFinished(std::chrono::milliseconds timeout = MY_WAIT_TIMEOUT);
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// The current renderer observer.
|
|
|
|
std::shared_ptr<NotificationRendererObserverInterface> m_observer;
|
|
|
|
|
|
|
|
/// Threads that are kicked off by mockRender() to wait for the rendering to begin and end, respectively.
|
|
|
|
std::thread m_renderStartedThread;
|
|
|
|
std::thread m_renderFinishedThread;
|
|
|
|
|
|
|
|
/// Used to notify the above threads.
|
|
|
|
std::condition_variable m_renderTrigger;
|
|
|
|
|
|
|
|
/// Flags for the state of the rendering operation.
|
|
|
|
bool m_startedRendering;
|
|
|
|
bool m_finishedRendering;
|
|
|
|
bool m_cancelling;
|
|
|
|
|
|
|
|
/// Promise to be fulfilled when @c renderNotification is called.
|
|
|
|
std::promise<void> m_renderStartedPromise;
|
|
|
|
|
|
|
|
/// Future to notify when @c renderNotification is called.
|
|
|
|
std::future<void> m_renderStartedFuture;
|
|
|
|
|
|
|
|
/// Promise to be fulfilled when @c renderNotification is done.
|
|
|
|
std::promise<void> m_renderFinishedPromise;
|
|
|
|
|
|
|
|
/// Future to notify when @c renderNotification is done.
|
|
|
|
std::future<void> m_renderFinishedFuture;
|
|
|
|
|
|
|
|
/// Serializes access to m_renderTrigger;
|
|
|
|
std::mutex m_mutex;
|
|
|
|
};
|
|
|
|
|
|
|
|
MockNotificationRenderer::~MockNotificationRenderer() {
|
|
|
|
if (m_renderStartedThread.joinable()) {
|
|
|
|
m_renderStartedThread.join();
|
|
|
|
}
|
|
|
|
if (m_renderFinishedThread.joinable()) {
|
|
|
|
m_renderFinishedThread.join();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MockNotificationRenderer::MockNotificationRenderer() :
|
|
|
|
m_observer{nullptr},
|
|
|
|
m_startedRendering{false},
|
|
|
|
m_finishedRendering{false},
|
|
|
|
m_cancelling{false},
|
|
|
|
m_renderStartedPromise{},
|
|
|
|
m_renderStartedFuture{m_renderStartedPromise.get_future()},
|
|
|
|
m_renderFinishedPromise{},
|
|
|
|
m_renderFinishedFuture{m_renderFinishedPromise.get_future()} {
|
|
|
|
}
|
|
|
|
|
|
|
|
void MockNotificationRenderer::addObserver(std::shared_ptr<NotificationRendererObserverInterface> observer) {
|
|
|
|
if (observer) {
|
|
|
|
m_observer = observer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MockNotificationRenderer::removeObserver(std::shared_ptr<NotificationRendererObserverInterface> observer) {
|
|
|
|
m_observer = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::renderNotification(
|
2020-04-13 22:56:35 +00:00
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> audioFactory,
|
2018-01-12 23:45:42 +00:00
|
|
|
const std::string& url) {
|
|
|
|
return renderNotificationShim(audioFactory, url);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::cancelNotificationRendering() {
|
|
|
|
return cancelNotificationRenderingShim();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::mockRender(
|
2020-04-13 22:56:35 +00:00
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()> audioFactory,
|
2018-01-12 23:45:42 +00:00
|
|
|
const std::string& url) {
|
|
|
|
std::lock_guard<std::mutex> lock(m_mutex);
|
|
|
|
|
|
|
|
if (m_renderStartedThread.joinable() && m_renderFinishedThread.joinable()) {
|
|
|
|
m_renderStartedThread.join();
|
|
|
|
m_renderFinishedThread.join();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_renderStartedThread = std::thread(&MockNotificationRenderer::waitForRenderCall, this);
|
|
|
|
m_renderFinishedThread = std::thread(&MockNotificationRenderer::waitForRenderCallDone, this);
|
|
|
|
|
|
|
|
m_startedRendering = true;
|
|
|
|
m_renderTrigger.notify_all();
|
|
|
|
|
|
|
|
std::this_thread::sleep_for(RENDER_TIME);
|
|
|
|
|
|
|
|
m_finishedRendering = true;
|
|
|
|
m_renderTrigger.notify_all();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::mockCancel() {
|
|
|
|
m_cancelling = true;
|
|
|
|
m_renderTrigger.notify_all();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::waitForRenderCall() {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
2020-02-19 18:35:26 +00:00
|
|
|
m_renderTrigger.wait_for(lock, MY_WAIT_TIMEOUT, [this]() { return m_startedRendering; });
|
2018-01-12 23:45:42 +00:00
|
|
|
m_renderStartedPromise.set_value();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::waitForRenderCallDone() {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
2020-02-19 18:35:26 +00:00
|
|
|
m_renderTrigger.wait_for(lock, MY_WAIT_TIMEOUT, [this]() { return m_cancelling || m_finishedRendering; });
|
2018-01-12 23:45:42 +00:00
|
|
|
m_renderFinishedPromise.set_value();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::waitUntilRenderingStarted(std::chrono::milliseconds timeout) {
|
|
|
|
if (m_renderStartedFuture.wait_for(timeout) == std::future_status::ready) {
|
|
|
|
m_startedRendering = false;
|
|
|
|
m_renderStartedPromise = std::promise<void>();
|
|
|
|
m_renderStartedFuture = m_renderStartedPromise.get_future();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MockNotificationRenderer::waitUntilRenderingFinished(std::chrono::milliseconds timeout) {
|
|
|
|
if (m_renderFinishedFuture.wait_for(timeout) == std::future_status::ready) {
|
|
|
|
m_finishedRendering = false;
|
|
|
|
m_renderFinishedPromise = std::promise<void>();
|
|
|
|
m_renderFinishedFuture = m_renderFinishedPromise.get_future();
|
|
|
|
m_observer->onNotificationRenderingFinished();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
class NotificationsCapabilityAgentTest : public ::testing::Test {
|
|
|
|
public:
|
|
|
|
void SetUp() override;
|
|
|
|
void TearDown() override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function to create the capability agent. This allows modifying of subcomponents before the CA is created.
|
|
|
|
*/
|
|
|
|
void initializeCapabilityAgent();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function to send SetIndicatorDirective
|
|
|
|
*/
|
|
|
|
void sendSetIndicatorDirective(const std::string& payload, const std::string& messageId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function to send ClearIndicatorDirective
|
|
|
|
*/
|
|
|
|
void sendClearIndicatorDirective(const std::string& messageId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function to generate direcive payloads
|
|
|
|
*/
|
|
|
|
const std::string generatePayload(
|
|
|
|
bool persistVisualIndicator,
|
|
|
|
bool playAudioIndicator,
|
|
|
|
const std::string& assetId = ASSET_ID1,
|
|
|
|
const std::string& assetUrl = ASSET_URL1);
|
|
|
|
|
2020-02-19 18:35:26 +00:00
|
|
|
/// The metric recorder.
|
|
|
|
std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
/// @c A test observer to wait for @c AudioPlayer state changes
|
|
|
|
std::shared_ptr<TestNotificationsObserver> m_testNotificationsObserver;
|
|
|
|
|
|
|
|
/// @c NotificationsCapabilityAgent to test
|
|
|
|
std::shared_ptr<NotificationsCapabilityAgent> m_notificationsCapabilityAgent;
|
|
|
|
|
|
|
|
/// @c Storage for notifications
|
|
|
|
std::shared_ptr<TestNotificationsStorage> m_notificationsStorage;
|
|
|
|
|
|
|
|
/// Player to play notification audio assets
|
|
|
|
std::shared_ptr<MockNotificationRenderer> m_renderer;
|
|
|
|
|
|
|
|
/// @c ContextManager to provide state and update state.
|
|
|
|
std::shared_ptr<MockContextManager> m_mockContextManager;
|
|
|
|
|
|
|
|
/// A directive handler result to send the result to.
|
|
|
|
std::unique_ptr<MockDirectiveHandlerResult> m_mockDirectiveHandlerResult;
|
|
|
|
|
|
|
|
/// An exception sender used to send exception encountered events to AVS.
|
|
|
|
std::shared_ptr<MockExceptionEncounteredSender> m_mockExceptionSender;
|
|
|
|
|
|
|
|
/// An audio factory for testing.
|
|
|
|
std::shared_ptr<TestNotificationsAudioFactory> m_testNotificationsAudioFactory;
|
|
|
|
|
|
|
|
/// Serializes access to m_setIndicatorTrigger.
|
|
|
|
std::mutex m_mutex;
|
|
|
|
|
|
|
|
/// Triggers threads waiting on a SetIndicator directive to be processed.
|
|
|
|
std::condition_variable m_setIndicatorTrigger;
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
/// Shared pointer to @c CustomerDataManager
|
|
|
|
std::shared_ptr<registrationManager::CustomerDataManager> m_dataManager;
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
/// A count of how many SetIndicator directives have been processed.
|
|
|
|
unsigned int m_numSetIndicatorsProcessed;
|
|
|
|
};
|
|
|
|
|
|
|
|
void NotificationsCapabilityAgentTest::initializeCapabilityAgent() {
|
|
|
|
m_notificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
|
|
|
m_notificationsStorage,
|
|
|
|
m_renderer,
|
|
|
|
m_mockContextManager,
|
|
|
|
m_mockExceptionSender,
|
2018-03-09 00:55:39 +00:00
|
|
|
m_testNotificationsAudioFactory,
|
2020-02-19 18:35:26 +00:00
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
ASSERT_TRUE(m_notificationsCapabilityAgent);
|
|
|
|
m_notificationsCapabilityAgent->addObserver(m_testNotificationsObserver);
|
|
|
|
m_renderer->addObserver(m_notificationsCapabilityAgent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NotificationsCapabilityAgentTest::SetUp() {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
auto inString = std::shared_ptr<std::istringstream>(new std::istringstream(NOTIFICATIONS_CONFIG_JSON));
|
|
|
|
ASSERT_TRUE(AlexaClientSDKInit::initialize({inString}));
|
2020-02-19 18:35:26 +00:00
|
|
|
m_metricRecorder = std::make_shared<NiceMock<avsCommon::utils::metrics::test::MockMetricRecorder>>();
|
2018-01-12 23:45:42 +00:00
|
|
|
m_notificationsStorage = std::make_shared<TestNotificationsStorage>();
|
|
|
|
m_renderer = MockNotificationRenderer::create();
|
|
|
|
m_mockContextManager = std::make_shared<NiceMock<MockContextManager>>();
|
|
|
|
m_mockExceptionSender = std::make_shared<NiceMock<MockExceptionEncounteredSender>>();
|
|
|
|
m_testNotificationsAudioFactory = std::make_shared<TestNotificationsAudioFactory>();
|
|
|
|
|
|
|
|
m_testNotificationsObserver = std::make_shared<TestNotificationsObserver>();
|
|
|
|
|
|
|
|
m_mockDirectiveHandlerResult = std::unique_ptr<MockDirectiveHandlerResult>(new MockDirectiveHandlerResult);
|
|
|
|
|
|
|
|
m_numSetIndicatorsProcessed = 0;
|
2018-03-09 00:55:39 +00:00
|
|
|
m_dataManager = std::make_shared<registrationManager::CustomerDataManager>();
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NotificationsCapabilityAgentTest::TearDown() {
|
|
|
|
if (m_notificationsCapabilityAgent) {
|
|
|
|
m_notificationsCapabilityAgent->shutdown();
|
|
|
|
}
|
|
|
|
AlexaClientSDKInit::uninitialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void NotificationsCapabilityAgentTest::sendSetIndicatorDirective(
|
|
|
|
const std::string& payload,
|
|
|
|
const std::string& messageId) {
|
|
|
|
auto avsMessageHeader = std::make_shared<AVSMessageHeader>(NAMESPACE_NOTIFICATIONS, NAME_SET_INDICATOR, messageId);
|
|
|
|
|
|
|
|
auto mockAttachmentManager = std::make_shared<MockAttachmentManager>();
|
|
|
|
|
|
|
|
std::shared_ptr<AVSDirective> setIndicatorDirective =
|
|
|
|
AVSDirective::create("", avsMessageHeader, payload, mockAttachmentManager, CONTEXT_ID_TEST);
|
|
|
|
|
|
|
|
// cast to DirectiveHandlerInterface so the compiler can find the correct preHandleDirective signature
|
|
|
|
std::shared_ptr<DirectiveHandlerInterface> agentAsDirectiveHandler = m_notificationsCapabilityAgent;
|
|
|
|
|
|
|
|
agentAsDirectiveHandler->preHandleDirective(setIndicatorDirective, std::move(m_mockDirectiveHandlerResult));
|
|
|
|
agentAsDirectiveHandler->handleDirective(messageId);
|
|
|
|
|
|
|
|
m_numSetIndicatorsProcessed++;
|
|
|
|
m_setIndicatorTrigger.notify_all();
|
|
|
|
}
|
|
|
|
|
|
|
|
void NotificationsCapabilityAgentTest::sendClearIndicatorDirective(const std::string& messageId) {
|
|
|
|
auto avsMessageHeader =
|
|
|
|
std::make_shared<AVSMessageHeader>(NAMESPACE_NOTIFICATIONS, NAME_CLEAR_INDICATOR, messageId);
|
|
|
|
|
|
|
|
auto mockAttachmentManager = std::make_shared<MockAttachmentManager>();
|
|
|
|
|
|
|
|
std::shared_ptr<AVSDirective> clearIndicatorDirective =
|
|
|
|
AVSDirective::create("", avsMessageHeader, "", mockAttachmentManager, CONTEXT_ID_TEST);
|
|
|
|
|
|
|
|
// cast to DirectiveHandlerInterface so the compiler can find the correct preHandleDirective signature
|
|
|
|
std::shared_ptr<DirectiveHandlerInterface> agentAsDirectiveHandler = m_notificationsCapabilityAgent;
|
|
|
|
|
|
|
|
agentAsDirectiveHandler->preHandleDirective(clearIndicatorDirective, std::move(m_mockDirectiveHandlerResult));
|
|
|
|
agentAsDirectiveHandler->handleDirective(messageId);
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string NotificationsCapabilityAgentTest::generatePayload(
|
|
|
|
bool persistVisualIndicator,
|
|
|
|
bool playAudioIndicator,
|
|
|
|
const std::string& assetId,
|
|
|
|
const std::string& assetUrl) {
|
|
|
|
std::string stringPersistVisualIndicator(persistVisualIndicator ? "true" : "false");
|
|
|
|
std::string stringPlayAudioIndicator(playAudioIndicator ? "true" : "false");
|
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
const std::string payload =
|
|
|
|
"{"
|
|
|
|
"\"persistVisualIndicator\":" + stringPersistVisualIndicator + ","
|
|
|
|
"\"playAudioIndicator\":" + stringPlayAudioIndicator + ","
|
|
|
|
"\"asset\": {"
|
|
|
|
"\"assetId\":\"" + assetId + "\","
|
|
|
|
"\"url\":\"" + assetUrl + "\""
|
|
|
|
|
|
|
|
"}"
|
|
|
|
"}";
|
|
|
|
// clang-format on
|
|
|
|
return payload;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test create() with nullptrs
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_create) {
|
2018-01-12 23:45:42 +00:00
|
|
|
std::shared_ptr<NotificationsCapabilityAgent> testNotificationsCapabilityAgent;
|
|
|
|
|
|
|
|
testNotificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
2018-03-09 00:55:39 +00:00
|
|
|
nullptr,
|
|
|
|
m_renderer,
|
|
|
|
m_mockContextManager,
|
|
|
|
m_mockExceptionSender,
|
|
|
|
m_testNotificationsAudioFactory,
|
2020-02-19 18:35:26 +00:00
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_EQ(testNotificationsCapabilityAgent, nullptr);
|
|
|
|
|
|
|
|
testNotificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
2018-03-09 00:55:39 +00:00
|
|
|
m_notificationsStorage,
|
|
|
|
nullptr,
|
|
|
|
m_mockContextManager,
|
|
|
|
m_mockExceptionSender,
|
|
|
|
m_testNotificationsAudioFactory,
|
2020-02-19 18:35:26 +00:00
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_EQ(testNotificationsCapabilityAgent, nullptr);
|
|
|
|
|
|
|
|
testNotificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
2018-03-09 00:55:39 +00:00
|
|
|
m_notificationsStorage,
|
|
|
|
m_renderer,
|
|
|
|
nullptr,
|
|
|
|
m_mockExceptionSender,
|
|
|
|
m_testNotificationsAudioFactory,
|
2020-02-19 18:35:26 +00:00
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_EQ(testNotificationsCapabilityAgent, nullptr);
|
|
|
|
|
|
|
|
testNotificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
2018-03-09 00:55:39 +00:00
|
|
|
m_notificationsStorage,
|
|
|
|
m_renderer,
|
|
|
|
m_mockContextManager,
|
|
|
|
nullptr,
|
|
|
|
m_testNotificationsAudioFactory,
|
2020-02-19 18:35:26 +00:00
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_EQ(testNotificationsCapabilityAgent, nullptr);
|
|
|
|
|
|
|
|
testNotificationsCapabilityAgent = NotificationsCapabilityAgent::create(
|
2020-02-19 18:35:26 +00:00
|
|
|
m_notificationsStorage,
|
|
|
|
m_renderer,
|
|
|
|
m_mockContextManager,
|
|
|
|
m_mockExceptionSender,
|
|
|
|
nullptr,
|
|
|
|
m_dataManager,
|
|
|
|
m_metricRecorder);
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_EQ(testNotificationsCapabilityAgent, nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test starting up the capability agent with a non-empty queue.
|
|
|
|
* Expect that the next item in the queue will be played.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_nonEmptyStartupQueue) {
|
2018-01-12 23:45:42 +00:00
|
|
|
NotificationIndicator ni(true, true, ASSET_ID1, ASSET_URL1);
|
|
|
|
ASSERT_TRUE(m_notificationsStorage->enqueue(ni));
|
|
|
|
|
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1)).Times(1);
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test a single SetIndicator directive with persistVisualIndicator and playAudioIndicator set to false.
|
|
|
|
* Expect that the NotificationsObserver is notified of the indicator's state remaining OFF.
|
|
|
|
* Expect no calls to render notifications since playAudioIndicator is false.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_sendSetIndicator) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, _)).Times(0);
|
|
|
|
initializeCapabilityAgent();
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
// check that the NotificationIndicator was dequeued as expected
|
|
|
|
ASSERT_TRUE(m_notificationsStorage->waitForQueueSizeToBe(0));
|
|
|
|
}
|
|
|
|
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
/**
|
|
|
|
* Test that duplicate SetIndicator directive with persistVisualIndicator and playAudioIndicator set to various values.
|
|
|
|
* Expect that the NotificationsObserver is notified of the indicator's count on initialization.
|
|
|
|
* Expect all calls to increase notification count.
|
|
|
|
*/
|
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_sendSetIndicatorIncreasesCount) {
|
|
|
|
initializeCapabilityAgent();
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(0, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(1, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
|
|
|
|
// A duplicate indication should trigger an increase in indicator count
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(2, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(3, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test that the indication count is preserved across shutdown.
|
|
|
|
*/
|
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_persistVisualIndicatorPreservedIncreasesCount) {
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false, ASSET_ID1), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(1, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
|
|
|
|
m_notificationsCapabilityAgent->shutdown();
|
|
|
|
|
|
|
|
// reboot and check that the indicator count value is preserved
|
|
|
|
initializeCapabilityAgent();
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(1, MY_WAIT_TIMEOUT));
|
Version 1.15 alexa-client-sdk
Changes in this update:
**Enhancements**
* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
- `[ "en-US", "es-US" ]`
- `[ "es-US", "en-US" ]`
- `[ "en-IN", "hi-IN" ]`
- `[ "hi-IN", "en-IN" ]`
- `[ "en-CA", "fr-CA" ]`
- `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
- Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
- Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
- Change wake word (`Alexa` supported for now).
- Toggle start of request tone on/off.
- Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.
**Bug Fixes**
* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](https://github.com/alexa/avs-device-sdk/pull/1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](https://github.com/alexa/avs-device-sdk/issues/1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2019-09-25 18:49:09 +00:00
|
|
|
}
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
/**
|
|
|
|
* Test a single SetIndicator directive with with playAudioIndicator set to true.
|
|
|
|
* Expect the renderer to start playback of the Notification.
|
|
|
|
* Expect that the NotificationsObserver is notified of the indicator's state being OFF.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_sendSetIndicatorWithAudio) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1));
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(false, true, ASSET_ID1, ASSET_URL1), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test a single SetIndicator directive with with persistVisualIndicator set to true.
|
|
|
|
* Expect that the NotificationsObserver is notified of the indicator's state being ON.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_sendSetIndicatorWithVisualIndicator) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, _)).Times(0);
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test sending two SetIndicator directives where the second has the same assetId as the first.
|
|
|
|
* Expect that the renderer only gets one call to renderNotification().
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_sameAssetId) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1))
|
|
|
|
.Times(1)
|
2020-04-13 22:56:35 +00:00
|
|
|
.WillOnce(
|
|
|
|
Invoke([this](
|
|
|
|
std::function<std::pair<std::unique_ptr<std::istream>, const avsCommon::utils::MediaType>()>
|
|
|
|
audioFactory,
|
|
|
|
const std::string& url) {
|
|
|
|
unsigned int expectedNumSetIndicators = 2;
|
|
|
|
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
if (!m_setIndicatorTrigger.wait_for(lock, MY_WAIT_TIMEOUT, [this, expectedNumSetIndicators]() {
|
|
|
|
return m_numSetIndicatorsProcessed == expectedNumSetIndicators;
|
|
|
|
})) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
m_renderer->mockRender(audioFactory, url);
|
|
|
|
EXPECT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
return true;
|
|
|
|
}));
|
2018-01-12 23:45:42 +00:00
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, ASSET_ID1), MESSAGE_ID_TEST);
|
|
|
|
|
|
|
|
// send a second SetIndicator with the same assetId but persistVisualIndicator set to false.
|
|
|
|
sendSetIndicatorDirective(generatePayload(false, true, ASSET_ID1), MESSAGE_ID_TEST2);
|
|
|
|
|
|
|
|
// the IndicatorState should not have changed since the second directive should have been ignored.
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test that the persistVisualIndicator setting is preserved and used across shutdown.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_persistVisualIndicatorPreserved) {
|
2018-01-12 23:45:42 +00:00
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
// set IndicatorState to ON
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, false, ASSET_ID1), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
m_notificationsCapabilityAgent->shutdown();
|
|
|
|
|
|
|
|
// reboot and check that the persistVisualIndicator value has been preserved
|
|
|
|
initializeCapabilityAgent();
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
// same test but with IndicatorState set to OFF
|
|
|
|
sendSetIndicatorDirective(generatePayload(false, false, ASSET_ID1), MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
m_notificationsCapabilityAgent->shutdown();
|
|
|
|
|
|
|
|
initializeCapabilityAgent();
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test sending a ClearIndicator directive with an empty queue, expecting nothing to happen.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_clearIndicatorWithEmptyQueue) {
|
2018-01-12 23:45:42 +00:00
|
|
|
initializeCapabilityAgent();
|
|
|
|
sendClearIndicatorDirective(MESSAGE_ID_TEST);
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test sending a ClearIndicator directive with an empty queue and the indicator state set to ON.
|
|
|
|
* Expect that the indicator is set to OFF.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_clearIndicatorWithEmptyQueueAndIndicatorOn) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1)).Times(1);
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, ASSET_ID1), MESSAGE_ID_TEST);
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::ON, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
|
|
|
|
sendClearIndicatorDirective(MESSAGE_ID_TEST2);
|
|
|
|
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-01-12 23:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test sending a ClearIndicator directive after multiple SetIndicator directives.
|
|
|
|
* Expect that the indicator is set to OFF.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, testSlow_clearIndicatorAfterMultipleSetIndicators) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1)).Times(1);
|
|
|
|
EXPECT_CALL(*(m_renderer.get()), cancelNotificationRenderingShim()).Times(1);
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "assetId1"), "firstIndicatorMessageId");
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "assetId2"), "secondIndicatorMessageId");
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "assetId3"), "thirdIndicatorMessageId");
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
sendClearIndicatorDirective(MESSAGE_ID_TEST);
|
|
|
|
|
|
|
|
// the renderer still calls onNotificationRenderingFinished() when a notification has been cancelled
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_notificationsStorage->waitForQueueSizeToBe(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test sending multiple SetIndicators and letting them all render.
|
|
|
|
* Expect multiple calls to renderNotification().
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_multipleSetIndicators) {
|
2018-01-12 23:45:42 +00:00
|
|
|
EXPECT_CALL(*(m_renderer.get()), renderNotificationShim(_, ASSET_URL1)).Times(3);
|
|
|
|
initializeCapabilityAgent();
|
|
|
|
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "id1"), "firstIndicatorMessageId");
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "id2"), "secondIndicatorMessageId");
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "id3"), "thirdIndicatorMessageId");
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingFinished());
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
/**
|
|
|
|
* Test that @c clearData() removes all notifications and sets the indicator to OFF.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(NotificationsCapabilityAgentTest, test_clearData) {
|
2018-03-09 00:55:39 +00:00
|
|
|
initializeCapabilityAgent();
|
|
|
|
sendSetIndicatorDirective(generatePayload(true, true, "assetId1"), "firstIndicatorMessageId");
|
|
|
|
ASSERT_TRUE(m_renderer->waitUntilRenderingStarted());
|
|
|
|
|
|
|
|
// Check that indicator is ON
|
|
|
|
IndicatorState state = IndicatorState::UNDEFINED;
|
|
|
|
m_notificationsStorage->getIndicatorState(&state);
|
|
|
|
ASSERT_EQ(state, IndicatorState::ON);
|
|
|
|
|
|
|
|
// Check that the notification queue is not empty
|
|
|
|
int queueSize;
|
|
|
|
m_notificationsStorage->getQueueSize(&queueSize);
|
|
|
|
ASSERT_GT(queueSize, 0);
|
|
|
|
|
|
|
|
m_notificationsCapabilityAgent->clearData();
|
|
|
|
ASSERT_TRUE(m_notificationsStorage->waitForQueueSizeToBe(0));
|
|
|
|
|
|
|
|
m_notificationsStorage->getIndicatorState(&state);
|
|
|
|
ASSERT_EQ(state, IndicatorState::OFF);
|
Version 1.16 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2).
- Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances.
- AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License.
**Bug Fixes**
- Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl).
- Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone.
- Added 'quit' (– q) to the settings sub menu.
- Fixed outdated dependencies issue in the Windows install script.
- Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert.
**Known Issues**
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
2019-10-25 20:19:44 +00:00
|
|
|
|
2020-02-19 18:35:26 +00:00
|
|
|
ASSERT_TRUE(m_testNotificationsObserver->waitFor(IndicatorState::OFF, MY_WAIT_TIMEOUT));
|
2018-03-09 00:55:39 +00:00
|
|
|
}
|
|
|
|
|
2018-01-12 23:45:42 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace notifications
|
|
|
|
} // namespace capabilityAgents
|
|
|
|
} // namespace alexaClientSDK
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
|
|
|
|
// ACSDK-1367 - Some tests fail on Windows
|
|
|
|
#if defined(_WIN32) && !defined(RESOLVED_ACSDK_1367)
|
|
|
|
::testing::GTEST_FLAG(filter) = "-NotificationsCapabilityAgentTest.testSameAssetId";
|
|
|
|
#endif
|
|
|
|
return RUN_ALL_TESTS();
|
2019-05-22 23:06:18 +00:00
|
|
|
}
|