From 7da524a48664f85f3856cfc845ad44c8f68e02f3 Mon Sep 17 00:00:00 2001 From: Caleigh Minshall Date: Mon, 27 Apr 2020 16:57:55 -0700 Subject: [PATCH] Version 1.19.1 alexa-client-sdk Changes in this update: - Fixed a bug that caused Display Cards for certain EMP adapters to stop rendering. 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). --- ...ckRenderPlayerInfoCardsObserverInterface.h | 40 +++++++++++++++++++ .../include/AVSCommon/Utils/SDKVersion.h | 4 +- CHANGELOG.md | 5 +++ CMakeLists.txt | 2 +- .../src/ExternalMediaPlayer.cpp | 2 +- .../test/ExternalMediaPlayerTest.cpp | 23 +++++++++++ 6 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 AVSCommon/SDKInterfaces/test/AVSCommon/SDKInterfaces/MockRenderPlayerInfoCardsObserverInterface.h diff --git a/AVSCommon/SDKInterfaces/test/AVSCommon/SDKInterfaces/MockRenderPlayerInfoCardsObserverInterface.h b/AVSCommon/SDKInterfaces/test/AVSCommon/SDKInterfaces/MockRenderPlayerInfoCardsObserverInterface.h new file mode 100644 index 00000000..61cee94c --- /dev/null +++ b/AVSCommon/SDKInterfaces/test/AVSCommon/SDKInterfaces/MockRenderPlayerInfoCardsObserverInterface.h @@ -0,0 +1,40 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKRENDERPLAYERINFOCARDSOBSERVERINTERFACE_H_ +#define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKRENDERPLAYERINFOCARDSOBSERVERINTERFACE_H_ + +#include "AVSCommon/SDKInterfaces/RenderPlayerInfoCardsObserverInterface.h" +#include + +namespace alexaClientSDK { +namespace avsCommon { +namespace sdkInterfaces { +namespace test { + +/** + * Mock class implementing @c RenderPlayerInfoCardsObserverInterface + */ +class MockRenderPlayerInfoCardsObserver : public RenderPlayerInfoCardsObserverInterface { +public: + MOCK_METHOD2(onRenderPlayerCardsInfoChanged, void(avsCommon::avs::PlayerActivity state, const Context& context)); +}; + +} // namespace test +} // namespace sdkInterfaces +} // namespace avsCommon +} // namespace alexaClientSDK + +#endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKRENDERPLAYERINFOCARDSOBSERVERINTERFACE_H_ diff --git a/AVSCommon/Utils/include/AVSCommon/Utils/SDKVersion.h b/AVSCommon/Utils/include/AVSCommon/Utils/SDKVersion.h index b9d87562..e8c061cc 100644 --- a/AVSCommon/Utils/include/AVSCommon/Utils/SDKVersion.h +++ b/AVSCommon/Utils/include/AVSCommon/Utils/SDKVersion.h @@ -29,7 +29,7 @@ namespace utils { namespace sdkVersion { inline static std::string getCurrentVersion() { - return "1.19.0"; + return "1.19.1"; } inline static int getMajorVersion() { @@ -41,7 +41,7 @@ inline static int getMinorVersion() { } inline static int getPatchVersion() { - return 0; + return 1; } } // namespace sdkVersion diff --git a/CHANGELOG.md b/CHANGELOG.md index 02d1401b..5105eeb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## ChangeLog +### Version 1.19.1 - April 27 2020 +* Fixed a bug that caused Display Cards for certain EMP adapters to stop rendering. + +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) + ### Version 1.19.0 - April 13 2020 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) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2941b708..41bd4e76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) # Set project information -project(AlexaClientSDK VERSION 1.19.0 LANGUAGES CXX) +project(AlexaClientSDK VERSION 1.19.1 LANGUAGES CXX) set(PROJECT_BRIEF "A cross-platform, modular SDK for interacting with the Alexa Voice Service") # This variable should be used by extension packages to include cmake files from this project. diff --git a/CapabilityAgents/ExternalMediaPlayer/src/ExternalMediaPlayer.cpp b/CapabilityAgents/ExternalMediaPlayer/src/ExternalMediaPlayer.cpp index dff6c6c4..7f74d4be 100644 --- a/CapabilityAgents/ExternalMediaPlayer/src/ExternalMediaPlayer.cpp +++ b/CapabilityAgents/ExternalMediaPlayer/src/ExternalMediaPlayer.cpp @@ -1059,7 +1059,7 @@ void ExternalMediaPlayer::setPlayerInFocus(const std::string& playerInFocus) { } } ACSDK_DEBUG(LX(__func__).d("playerInFocus", playerInFocus)); - auto adapterInFocus = getAdapterByLocalPlayerId(playerInFocus); + auto adapterInFocus = getAdapterByPlayerId(playerInFocus); { std::lock_guard lock{m_inFocusAdapterMutex}; diff --git a/CapabilityAgents/ExternalMediaPlayer/test/ExternalMediaPlayerTest.cpp b/CapabilityAgents/ExternalMediaPlayer/test/ExternalMediaPlayerTest.cpp index 43652be5..ce5f2319 100644 --- a/CapabilityAgents/ExternalMediaPlayer/test/ExternalMediaPlayerTest.cpp +++ b/CapabilityAgents/ExternalMediaPlayer/test/ExternalMediaPlayerTest.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -2123,6 +2124,28 @@ TEST_F(ExternalMediaPlayerTest, testSetPlayerInFocusFailsForAuthorized) { ASSERT_TRUE(std::future_status::ready == m_wakeSetStateFuture.wait_for(MY_WAIT_TIMEOUT)); } +/** + * Test setPlayerInFocus notifies any RenderPlayerInfoCardsObservers. + */ +TEST_F(ExternalMediaPlayerTest, testSetPlayerInFocusNotfiesTemplateRuntimeObserver) { + std::promise promise; + std::future future = promise.get_future(); + + auto renderCardObserver = std::make_shared(); + m_externalMediaPlayer->setObserver(renderCardObserver); + + EXPECT_CALL(*renderCardObserver, onRenderPlayerCardsInfoChanged(_, _)) + .WillOnce(Invoke([&promise]( + avsCommon::avs::PlayerActivity state, + const RenderPlayerInfoCardsObserverInterface::Context& context) { promise.set_value(); })); + + // Authorized from SetUp(). + m_externalMediaPlayer->setPlayerInFocus(MSP1_PLAYER_ID); + m_externalMediaPlayer->provideState(PLAYBACK_STATE, PROVIDE_STATE_TOKEN_TEST); + + ASSERT_TRUE(std::future_status::ready == future.wait_for(MY_WAIT_TIMEOUT)); +} + } // namespace test } // namespace externalMediaPlayer } // namespace capabilityAgents