Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 2e9428e

Browse files
committed
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:](#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:](#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.
1 parent 34b2a99 commit 2e9428e

208 files changed

Lines changed: 33725 additions & 3689 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ACL/include/ACL/Transport/ExchangeHandlerContextInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ class ExchangeHandlerContextInterface {
4646
virtual void onDownchannelFinished() = 0;
4747

4848
/**
49-
* Notification that an @c MessgeRequest has been sent.
49+
* Notification that an @c MessageRequest has been sent.
5050
*/
5151
virtual void onMessageRequestSent() = 0;
5252

ACL/src/Transport/HTTP2Transport.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ HTTP2Transport::HTTP2Transport(
188188
}
189189

190190
void HTTP2Transport::addObserver(std::shared_ptr<TransportObserverInterface> transportObserver) {
191-
ACSDK_DEBUG5(LX(__func__).d("transportObserver", transportObserver.get()));
191+
ACSDK_DEBUG7(LX(__func__).d("transportObserver", transportObserver.get()));
192192

193193
if (!transportObserver) {
194194
ACSDK_ERROR(LX("addObserverFailed").d("reason", "nullObserver"));
@@ -200,7 +200,7 @@ void HTTP2Transport::addObserver(std::shared_ptr<TransportObserverInterface> tra
200200
}
201201

202202
void HTTP2Transport::removeObserver(std::shared_ptr<TransportObserverInterface> transportObserver) {
203-
ACSDK_DEBUG5(LX(__func__).d("transportObserver", transportObserver.get()));
203+
ACSDK_DEBUG7(LX(__func__).d("transportObserver", transportObserver.get()));
204204

205205
if (!transportObserver) {
206206
ACSDK_ERROR(LX("removeObserverFailed").d("reason", "nullObserver"));
@@ -322,7 +322,7 @@ void HTTP2Transport::onAuthStateChange(
322322
}
323323

324324
void HTTP2Transport::doShutdown() {
325-
ACSDK_DEBUG5(LX(__func__));
325+
ACSDK_DEBUG7(LX(__func__));
326326
setState(State::SHUTDOWN, ConnectionStatusObserverInterface::ChangedReason::ACL_CLIENT_REQUEST);
327327
disconnect();
328328
m_authDelegate->removeAuthObserver(shared_from_this());
@@ -336,12 +336,12 @@ void HTTP2Transport::doShutdown() {
336336
}
337337

338338
void HTTP2Transport::onDownchannelConnected() {
339-
ACSDK_DEBUG5(LX(__func__));
339+
ACSDK_DEBUG7(LX(__func__));
340340
setState(State::POST_CONNECTING, ConnectionStatusObserverInterface::ChangedReason::SUCCESS);
341341
}
342342

343343
void HTTP2Transport::onDownchannelFinished() {
344-
ACSDK_DEBUG5(LX(__func__));
344+
ACSDK_DEBUG7(LX(__func__));
345345

346346
std::lock_guard<std::mutex> lock(m_mutex);
347347

@@ -437,7 +437,7 @@ std::string HTTP2Transport::getEndpoint() {
437437
}
438438

439439
void HTTP2Transport::mainLoop() {
440-
ACSDK_DEBUG5(LX(__func__));
440+
ACSDK_DEBUG7(LX(__func__));
441441

442442
m_postConnect = m_postConnectFactory->createPostConnect();
443443
if (!m_postConnect || !m_postConnect->doPostConnect(shared_from_this())) {
@@ -471,6 +471,7 @@ void HTTP2Transport::mainLoop() {
471471
break;
472472
case State::SERVER_SIDE_DISCONNECT:
473473
nextState = handleServerSideDisconnect();
474+
break;
474475
case State::DISCONNECTING:
475476
nextState = handleDisconnecting();
476477
break;
@@ -481,7 +482,7 @@ void HTTP2Transport::mainLoop() {
481482

482483
handleShutdown();
483484

484-
ACSDK_DEBUG5(LX("mainLoopExiting"));
485+
ACSDK_DEBUG7(LX("mainLoopExiting"));
485486
}
486487

487488
HTTP2Transport::State HTTP2Transport::handleInit() {
@@ -540,7 +541,7 @@ HTTP2Transport::State HTTP2Transport::handleWaitingToRetryConnecting() {
540541
ACSDK_DEBUG7(LX(__func__));
541542

542543
std::chrono::milliseconds timeout = TransportDefines::RETRY_TIMER.calculateTimeToRetry(m_connectRetryCount);
543-
ACSDK_DEBUG5(
544+
ACSDK_DEBUG7(
544545
LX("handleConnectingWaitingToRetry").d("connectRetryCount", m_connectRetryCount).d("timeout", timeout.count()));
545546
m_connectRetryCount++;
546547
std::unique_lock<std::mutex> lock(m_mutex);

ACL/src/Transport/MessageRequestHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ std::shared_ptr<MessageRequestHandler> MessageRequestHandler::create(
8181
std::shared_ptr<avsCommon::avs::MessageRequest> messageRequest,
8282
std::shared_ptr<MessageConsumerInterface> messageConsumer,
8383
std::shared_ptr<avsCommon::avs::attachment::AttachmentManager> attachmentManager) {
84-
ACSDK_DEBUG5(LX(__func__).d("context", context.get()).d("messageRequest", messageRequest.get()));
84+
ACSDK_DEBUG7(LX(__func__).d("context", context.get()).d("messageRequest", messageRequest.get()));
8585

8686
if (!context) {
8787
ACSDK_CRITICAL(LX("MessageRequestHandlerCreateFailed").d("reason", "nullHttp2Transport"));

ACL/src/Transport/MessageRouter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ void MessageRouter::onDisconnected(
183183

184184
void MessageRouter::onServerSideDisconnect(std::shared_ptr<TransportInterface> transport) {
185185
std::unique_lock<std::mutex> lock{m_connectionMutex};
186+
ACSDK_DEBUG5(LX("server-side disconnect received").d("Message router is enabled", m_isEnabled));
186187
if (m_isEnabled) {
187188
setConnectionStatusLocked(
188189
ConnectionStatusObserverInterface::Status::PENDING,

ACL/test/Transport/MockAuthDelegate.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -50,10 +50,10 @@ class MockAuthDelegate : public avsCommon::sdkInterfaces::AuthDelegateInterface
5050
std::string m_authToken;
5151
};
5252

53-
std::string MockAuthDelegate::getAuthToken() {
53+
inline std::string MockAuthDelegate::getAuthToken() {
5454
return m_authToken;
5555
}
56-
void MockAuthDelegate::setAuthToken(std::string authToken) {
56+
inline void MockAuthDelegate::setAuthToken(std::string authToken) {
5757
m_authToken = authToken;
5858
}
5959

ADSL/src/DirectiveProcessor.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,20 @@ bool DirectiveProcessor::onDirective(std::shared_ptr<AVSDirective> directive) {
8989

9090
if (bypassDialogRequestIDCheck) {
9191
ACSDK_INFO(LX("onDirective")
92+
.d("messageId", directive->getMessageId())
9293
.d("action", "bypassingDialogRequestIdCheck")
9394
.d("reason", "routinesDirectiveContainsDialogRequestId")
94-
.d("directiveNamespace", "InteractionModel")
95-
.d("directiveName", "NewDialogRequest"));
95+
.d("namespace", directive->getNamespace())
96+
.d("name", directive->getName())
97+
.d("directivesDialogRequestId", directive->getDialogRequestId())
98+
.d("dialogRequestId", m_dialogRequestId));
9699
} else if (!directive->getDialogRequestId().empty() && directive->getDialogRequestId() != m_dialogRequestId) {
97100
ACSDK_INFO(LX("onDirective")
98101
.d("messageId", directive->getMessageId())
99102
.d("action", "dropped")
100103
.d("reason", "dialogRequestIdDoesNotMatch")
104+
.d("namespace", directive->getNamespace())
105+
.d("name", directive->getName())
101106
.d("directivesDialogRequestId", directive->getDialogRequestId())
102107
.d("dialogRequestId", m_dialogRequestId));
103108
return true;
@@ -408,7 +413,13 @@ bool DirectiveProcessor::handleQueuedDirectivesLocked(std::unique_lock<std::mute
408413
}
409414

410415
if (!handleDirectiveSucceeded) {
411-
ACSDK_ERROR(LX("handleDirectiveFailed").d("message id", directive->getMessageId()));
416+
ACSDK_ERROR(LX("handleDirectiveFailed")
417+
.d("message id", directive->getMessageId())
418+
.d("namespace", directive->getNamespace())
419+
.d("name", directive->getName())
420+
.d("reason", "dialog request id does not match")
421+
.d("directive's dialog request id", directive->getDialogRequestId())
422+
.d("dialog request id", m_dialogRequestId));
412423
scrubDialogRequestIdLocked(directive->getDialogRequestId());
413424
}
414425
}

ADSL/test/DirectiveSequencerTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ TEST_F(DirectiveSequencerTest, test_handleBlockingThenImmediatelyThenNonBockingO
780780
EXPECT_CALL(*(handler1.get()), preHandleDirective(directive1, _)).Times(1).InSequence(s1, s2);
781781
EXPECT_CALL(*(handler2.get()), preHandleDirective(directive2, _)).Times(1).InSequence(s2);
782782

783-
EXPECT_CALL(*(handler1.get()), handleDirective(_)).Times(1).InSequence(s2);
783+
EXPECT_CALL(*(handler1.get()), handleDirective(_)).Times(1).InSequence(s1);
784784
EXPECT_CALL(*(handler1.get()), cancelDirective(_)).Times(0);
785785

786786
EXPECT_CALL(*(handler2.get()), handleDirectiveImmediately(_)).Times(0);

AVSCommon/AVS/include/AVSCommon/AVS/CapabilityAgent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -220,7 +220,7 @@ class CapabilityAgent
220220
const std::string& eventName,
221221
const std::string& dialogRequestIdString = "",
222222
const std::string& payload = "{}",
223-
const std::string& context = "");
223+
const std::string& context = "") const;
224224

225225
/// The namespace of the capability agent.
226226
const std::string m_namespace;

AVSCommon/AVS/include/AVSCommon/AVS/EventBuilder.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -22,6 +22,21 @@
2222
namespace alexaClientSDK {
2323
namespace avsCommon {
2424
namespace avs {
25+
namespace constants {
26+
27+
/// The namespace key in the header of the event.
28+
static const std::string NAMESPACE_KEY_STRING = "namespace";
29+
30+
/// The name key in the header of the event.
31+
static const std::string NAME_KEY_STRING = "name";
32+
33+
/// The header key in the event.
34+
static const std::string HEADER_KEY_STRING = "header";
35+
36+
/// The payload key in the event.
37+
static const std::string PAYLOAD_KEY_STRING = "payload";
38+
39+
} // namespace constants
2540

2641
/**
2742
* Builds a JSON event string which includes the header, the @c payload and an optional @c context.

AVSCommon/AVS/src/Attachment/AttachmentManager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -99,7 +99,8 @@ AttachmentManager::AttachmentManagementDetails& AttachmentManager::getDetailsLoc
9999
switch (m_attachmentType) {
100100
// The in-process attachment type.
101101
case AttachmentType::IN_PROCESS:
102-
details.attachment = make_unique<InProcessAttachment>(attachmentId);
102+
details.attachment =
103+
alexaClientSDK::avsCommon::utils::memory::make_unique<InProcessAttachment>(attachmentId);
103104
break;
104105
}
105106

0 commit comments

Comments
 (0)