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

Commit 4bb0d23

Browse files
committed
Version 1.20.1 alexa-client-sdk
Changes in this update: Feature enhancements, updates, and resolved issues from all releases are available on the [Amazon developer portal](https://developer.amazon.com/docs/alexa/avs-device-sdk/release-notes.html).
1 parent f82767c commit 4bb0d23

8 files changed

Lines changed: 19 additions & 122 deletions

File tree

AVSCommon/Utils/include/AVSCommon/Utils/SDKVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace utils {
2929
namespace sdkVersion {
3030

3131
inline static std::string getCurrentVersion() {
32-
return "1.20.0";
32+
return "1.20.1";
3333
}
3434

3535
inline static int getMajorVersion() {
@@ -41,7 +41,7 @@ inline static int getMinorVersion() {
4141
}
4242

4343
inline static int getPatchVersion() {
44-
return 0;
44+
return 1;
4545
}
4646

4747
} // namespace sdkVersion

ApplicationUtilities/SDKComponent/src/SDKComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace SDKComponent {
2626
using namespace avsCommon::utils::logger;
2727

2828
// Name of the Component to add to ComponentReporter
29-
static const std::string SDK_COMPONENT_NAME = "com.amazon.sdk";
29+
static const std::string SDK_COMPONENT_NAME = "com.amazon.alexa.deviceSDK";
3030

3131
/// String to identify log entries originating from this file.
3232
static const std::string TAG("SDKComponent");

ApplicationUtilities/SDKComponent/test/SDKComponentTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using namespace ::testing;
3333
using namespace avsCommon::avs;
3434

3535
// Name of the SDK Component Added to Component Reporter
36-
static const std::string SDK_COMPONENT_NAME = "com.amazon.sdk";
36+
static const std::string SDK_COMPONENT_NAME = "com.amazon.alexa.deviceSDK";
3737

3838
/**
3939
* Test SDKComponent correctly returns sdk version in SDKVersion.h

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
## ChangeLog
2+
3+
### Version 1.20.1 - August 6 2020
4+
Feature enhancements, updates, and resolved issues from all releases are available on the [Amazon developer portal](https://developer.amazon.com/docs/alexa/avs-device-sdk/release-notes.html)
5+
26
### Version 1.20.0 - June 22 2020
37
Feature enhancements, updates, and resolved issues from all releases are available on the [Amazon developer portal](https://developer.amazon.com/docs/alexa/avs-device-sdk/release-notes.html)
48

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
22

33
# Set project information
4-
project(AlexaClientSDK VERSION 1.20.0 LANGUAGES CXX)
4+
project(AlexaClientSDK VERSION 1.20.1 LANGUAGES CXX)
55
set(PROJECT_BRIEF "A cross-platform, modular SDK for interacting with the Alexa Voice Service")
66

77
# This variable should be used by extension packages to include cmake files from this project.

CapabilityAgents/TemplateRuntime/src/TemplateRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void TemplateRuntime::doShutdown() {
286286
m_activeRenderPlayerInfoCardsProvider.reset();
287287
m_audioItemsInExecution.clear();
288288
m_audioPlayerInfo.clear();
289-
for (const auto renderPlayerInfoCardsInterface : m_renderPlayerInfoCardsInterfaces) {
289+
for (const auto& renderPlayerInfoCardsInterface : m_renderPlayerInfoCardsInterfaces) {
290290
renderPlayerInfoCardsInterface->setObserver(nullptr);
291291
}
292292
m_renderPlayerInfoCardsInterfaces.clear();

CertifiedSender/src/CertifiedSender.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717

1818
#include <AVSCommon/AVS/MessageRequest.h>
1919
#include <AVSCommon/Utils/Logger/Logger.h>
20+
#include <AVSCommon/Utils/Configuration/ConfigurationNode.h>
2021
#include <RegistrationManager/CustomerDataManager.h>
2122

22-
#include <queue>
23-
2423
namespace alexaClientSDK {
2524
namespace certifiedSender {
2625

@@ -168,23 +167,6 @@ bool CertifiedSender::init() {
168167
}
169168
}
170169

171-
/// Load stored messages from storage.
172-
std::queue<MessageStorageInterface::StoredMessage> storedMessages;
173-
if (!m_storage->load(&storedMessages)) {
174-
ACSDK_ERROR(LX("initFailed").m("Could not load messages from database file."));
175-
return false;
176-
}
177-
178-
while (!storedMessages.empty()) {
179-
auto storedMessage = storedMessages.front();
180-
{
181-
std::lock_guard<std::mutex> lock{m_mutex};
182-
m_messagesToSend.push_back(std::make_shared<CertifiedMessageRequest>(
183-
storedMessage.message, storedMessage.id, storedMessage.uriPathExtension));
184-
}
185-
storedMessages.pop();
186-
}
187-
188170
m_workerThread = std::thread(&CertifiedSender::mainloop, this);
189171

190172
return true;

CertifiedSender/test/CertifiedSenderTest.cpp

Lines changed: 8 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*/
1515

1616
#include <chrono>
17+
#include <future>
1718
#include <memory>
18-
#include <queue>
1919

2020
#include <gtest/gtest.h>
2121

@@ -85,22 +85,20 @@ class CertifiedSenderTest : public ::testing::Test {
8585
(*configuration) << CONFIGURATION;
8686
ASSERT_TRUE(avsCommon::avs::initialization::AlexaClientSDKInit::initialize({configuration}));
8787

88-
m_customerDataManager = std::make_shared<registrationManager::CustomerDataManager>();
88+
auto customerDataManager = std::make_shared<registrationManager::CustomerDataManager>();
8989
m_mockMessageSender = std::make_shared<avsCommon::sdkInterfaces::test::MockMessageSender>();
9090
m_connection = std::make_shared<MockConnection>();
9191
m_storage = std::make_shared<MockMessageStorage>();
9292

9393
EXPECT_CALL(*m_storage, open()).Times(1).WillOnce(Return(true));
94-
EXPECT_CALL(*m_storage, load(_)).Times(1).WillOnce(Return(true));
95-
m_certifiedSender =
96-
CertifiedSender::create(m_mockMessageSender, m_connection, m_storage, m_customerDataManager);
94+
m_certifiedSender = CertifiedSender::create(m_mockMessageSender, m_connection, m_storage, customerDataManager);
9795
}
9896

9997
void TearDown() override {
10098
if (avsCommon::avs::initialization::AlexaClientSDKInit::isInitialized()) {
10199
avsCommon::avs::initialization::AlexaClientSDKInit::uninitialize();
102100
}
103-
m_certifiedSender->shutdown();
101+
m_connection->removeConnectionStatusObserver(m_certifiedSender);
104102
}
105103

106104
/// Class under test.
@@ -113,9 +111,6 @@ class CertifiedSenderTest : public ::testing::Test {
113111
/// be deleted.
114112
std::shared_ptr<MockConnection> m_connection;
115113

116-
/// The pointer to the customer data manager
117-
std::shared_ptr<registrationManager::CustomerDataManager> m_customerDataManager;
118-
119114
/// The mock message sender instance.
120115
std::shared_ptr<avsCommon::sdkInterfaces::test::MockMessageSender> m_mockMessageSender;
121116
};
@@ -128,101 +123,17 @@ TEST_F(CertifiedSenderTest, test_clearData) {
128123
m_certifiedSender->clearData();
129124
}
130125

131-
/**
132-
* Tests various failure scenarios for the init method.
133-
*/
134-
TEST_F(CertifiedSenderTest, test_initFailsWhenStorageMethodsFail) {
135-
/// Test if the init method fails when createDatabase on storage fails.
136-
{
137-
EXPECT_CALL(*m_storage, open()).Times(1).WillOnce(Return(false));
138-
EXPECT_CALL(*m_storage, createDatabase()).Times(1).WillOnce(Return(false));
139-
EXPECT_CALL(*m_storage, load(_)).Times(0);
140-
auto certifiedSender =
141-
CertifiedSender::create(m_mockMessageSender, m_connection, m_storage, m_customerDataManager);
142-
ASSERT_EQ(certifiedSender, nullptr);
143-
}
144-
145-
/// Test if the init method fails when load from storage fails.
146-
{
147-
EXPECT_CALL(*m_storage, open()).Times(1).WillOnce(Return(true));
148-
EXPECT_CALL(*m_storage, load(_)).Times(1).WillOnce(Return(false));
149-
auto certifiedSender =
150-
CertifiedSender::create(m_mockMessageSender, m_connection, m_storage, m_customerDataManager);
151-
ASSERT_EQ(certifiedSender, nullptr);
152-
}
153-
}
154-
155-
/**
156-
* Tests if the stored messages get sent when a connection is established.
157-
*/
158-
TEST_F(CertifiedSenderTest, testTimer_storedMessagesGetSent) {
159-
EXPECT_CALL(*m_storage, open()).Times(1).WillOnce(Return(true));
160-
161-
/// Return messages from storage.
162-
EXPECT_CALL(*m_storage, load(_))
163-
.Times(1)
164-
.WillOnce(Invoke([](std::queue<MessageStorageInterface::StoredMessage>* storedMessages) {
165-
storedMessages->push(MessageStorageInterface::StoredMessage(1, "testMessage_1"));
166-
storedMessages->push(MessageStorageInterface::StoredMessage(2, "testMessage_2"));
167-
return true;
168-
}));
169-
170-
avsCommon::utils::PromiseFuturePair<bool> allRequestsSent;
171-
{
172-
InSequence s;
173-
174-
EXPECT_CALL(*m_mockMessageSender, sendMessage(_))
175-
.Times(1)
176-
.WillOnce(Invoke([](std::shared_ptr<avsCommon::avs::MessageRequest> request) {
177-
ASSERT_EQ(request->getJsonContent(), "testMessage_1");
178-
request->sendCompleted(avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS);
179-
}));
180-
EXPECT_CALL(*m_storage, erase(1)).WillOnce(Return(true));
181-
182-
EXPECT_CALL(*m_mockMessageSender, sendMessage(_))
183-
.Times(1)
184-
.WillOnce(Invoke([](std::shared_ptr<avsCommon::avs::MessageRequest> request) {
185-
ASSERT_EQ(request->getJsonContent(), "testMessage_2");
186-
request->sendCompleted(avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS);
187-
}));
188-
EXPECT_CALL(*m_storage, erase(2)).WillOnce(Invoke([&allRequestsSent](int messageId) {
189-
allRequestsSent.setValue(true);
190-
return true;
191-
}));
192-
}
193-
194-
auto certifiedSender = CertifiedSender::create(m_mockMessageSender, m_connection, m_storage, m_customerDataManager);
195-
196-
std::static_pointer_cast<avsCommon::sdkInterfaces::ConnectionStatusObserverInterface>(certifiedSender)
197-
->onConnectionStatusChanged(
198-
avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status::CONNECTED,
199-
avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason::SUCCESS);
200-
201-
/// wait for requests to get sent out.
202-
EXPECT_TRUE(allRequestsSent.waitFor(TEST_TIMEOUT));
203-
204-
/// Cleanup
205-
certifiedSender->shutdown();
206-
}
207-
208126
/**
209127
* Verify that a message with a URI specified will be sent out by the sender with the URI.
210128
*/
211129
TEST_F(CertifiedSenderTest, testTimer_SendMessageWithURI) {
212130
avsCommon::utils::PromiseFuturePair<std::shared_ptr<avsCommon::avs::MessageRequest>> requestSent;
213-
131+
EXPECT_CALL(*m_mockMessageSender, sendMessage(_))
132+
.WillOnce(Invoke([&requestSent](std::shared_ptr<avsCommon::avs::MessageRequest> request) {
133+
requestSent.setValue(request);
134+
}));
214135
EXPECT_CALL(*m_storage, store(_, TEST_URI, _)).WillOnce(Return(true));
215136

216-
{
217-
InSequence s;
218-
EXPECT_CALL(*m_mockMessageSender, sendMessage(_))
219-
.WillOnce(Invoke([&requestSent](std::shared_ptr<avsCommon::avs::MessageRequest> request) {
220-
requestSent.setValue(request);
221-
request->sendCompleted(avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS);
222-
}));
223-
EXPECT_CALL(*m_storage, erase(_)).WillOnce(Return(true));
224-
}
225-
226137
std::static_pointer_cast<avsCommon::sdkInterfaces::ConnectionStatusObserverInterface>(m_certifiedSender)
227138
->onConnectionStatusChanged(
228139
avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status::CONNECTED,

0 commit comments

Comments
 (0)