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

Commit

Permalink
* Upgraded dependency to Device SDK 1.24.0 [https://github.com/alexa/…
Browse files Browse the repository at this point in the history
…avs-device-sdk/tree/v1.24.0]

* Added support for APL 1.6 [https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-latest-version.html]
* Added support for Alexa.Presentation.APL 1.3 [https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/presentation-apl.html#version-changes]
* Added support for timeoutType from Alexa.Presentation.APL RenderDocument directives [https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/presentation-apl.html#renderdocument]
* Moved metric payload handling logic into APLClientLibrary
* Removed user-specified schema path for SmartScreenSDKConfig.json validation in favor of internal schema file
* Hardened AlexaPresentation CA logic to align with the existing limitation of only being able to support one active APL directive document at a time
* Upgraded Node version requirement to 14.0, added Node version check
* Added warning message when building in DEBUG mode
  • Loading branch information
chemudug-amzn committed Jun 24, 2021
1 parent 03354f9 commit 9480393
Show file tree
Hide file tree
Showing 235 changed files with 4,043 additions and 1,916 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### v2.7.0 released 06/01/2021:
#### Enhancements
* Upgraded dependency to Device SDK 1.24.0 [https://github.com/alexa/avs-device-sdk/tree/v1.24.0]
* Added support for APL 1.6 [https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-latest-version.html]
* Added support for Alexa.Presentation.APL 1.3 [https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/presentation-apl.html#version-changes]
* Added support for timeoutType from Alexa.Presentation.APL RenderDocument directives [https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/presentation-apl.html#renderdocument]
* Moved metric payload handling logic into APLClientLibrary
* Removed user-specified schema path for SmartScreenSDKConfig.json validation in favor of internal schema file
* Hardened AlexaPresentation CA logic to align with the existing limitation of only being able to support one active APL directive document at a time
* Upgraded Node version requirement to 14.0, added Node version check
* Added warning message when building in DEBUG mode

#### Bug fixes
* Fixed issue that RenderPlayerInfo card does not get rendered until the previously displayed APL card times out.
* Fixed issue that AlexaPresentation CA sends incorrect IPC messages to GUI App, causing GUI App to maintain an incorrect window state.

### v2.6.0 released 04/01/2021:
#### Enhancements
* Upgraded dependency to Device SDK 1.23.0 [https://github.com/alexa/avs-device-sdk/tree/v1.23.0]
Expand All @@ -18,7 +34,7 @@
#### Enhancements
* Upgraded dependency to Device SDK 1.22.0 [https://github.com/alexa/avs-device-sdk/tree/v1.22.0]
* Added support for multiple concurrent APL clients
* Added support for APL 1.5 [https://aplspec.aka.corp.amazon.com/release-1.5/html/index.html#apl-specification-1-5]
* Added support for APL 1.5 [https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-latest-version.html]
* Ported DISABLE_DUCKING cmake configuration from Alexa-device-sdk
* Music playback now ducks instead of pauses when APL TTS is executed
* Updated ini patch version to 1.3.6
Expand Down Expand Up @@ -46,7 +62,7 @@

#### Enhancements
* Upgraded dependency to Device SDK 1.20.1 [https://github.com/alexa/avs-device-sdk/tree/v1.20.1]
* Support for APL 1.4 [https://aplspec.aka.corp.amazon.com/release-1.4/html/index.html#apl-specification-1-4]
* Support for APL 1.4 [https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-changes-1-4.html]
* Added APL Telemetry Support
* TV Overlay Portrait is no longer supported
* Added support for APL Extensions [https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-latest-version.html#apl-extensions-and-the-backstack]
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)

project(AlexaSmartScreenSDK VERSION 2.6 LANGUAGES CXX)
project(AlexaSmartScreenSDK VERSION 2.7 LANGUAGES CXX)
set(PROJECT_BRIEF "A cross-platform, modular SDK for multi modal interaction with the Alexa Voice Service")
configure_file (
"${PROJECT_SOURCE_DIR}/modules/Alexa/Utils/include/Utils/SmartScreenSDKVersion.h.in"
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Alexa Smart Screen SDK

<p>
<a href="https://github.com/alexa/alexa-smart-screen-sdk/tree/v2.6.0" alt="version">
<img src="https://img.shields.io/badge/stable%20version-2.6.0-brightgreen" /></a>
<a href="https://github.com/alexa/avs-device-sdk/tree/v1.23.0" alt="DeviceSDK">
<img src="https://img.shields.io/badge/avs%20device%20sdk-1.23.0-blueviolet" /></a>
<a href="https://github.com/alexa/apl-core-library/tree/v1.5.1" alt="APLCore">
<img src="https://img.shields.io/badge/apl%20core%20library-1.5.1-navy" /></a>
<a href="https://github.com/alexa/alexa-smart-screen-sdk/tree/v2.7.0" alt="version">
<img src="https://img.shields.io/badge/stable%20version-2.7.0-brightgreen" /></a>
<a href="https://github.com/alexa/avs-device-sdk/tree/v1.24.0" alt="DeviceSDK">
<img src="https://img.shields.io/badge/avs%20device%20sdk-1.24.0-blueviolet" /></a>
<a href="https://github.com/alexa/apl-core-library/tree/v1.6.1" alt="APLCore">
<img src="https://img.shields.io/badge/apl%20core%20library-1.6.1-navy" /></a>
<a href="https://github.com/alexa/alexa-smart-screen-sdk/issues" alt="issues">
<img src="https://img.shields.io/github/issues/alexa/alexa-smart-screen-sdk" /></a>
</p>
Expand Down Expand Up @@ -66,7 +66,7 @@ This diagram illustrates the data flows between components that comprise the Ale

## Security Best Practices

All Alexa products should adopt the [Security Best Practices for Alexa](https://developer.amazon.com/docs/alexa-voice-service/security-best-practices.html). Security requirements for the Smart Screen SDK can be found in [Security Requirements for Smart Screen AVS](https://github.com/alexa/alexa-smart-screen-sdk/wiki/Security-Requirements-for-Smart-Screen-AVS).
All Alexa products should adopt the [AVS Security Requirements](https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/avs-security-reqs.html). Security requirements for the Smart Screen SDK can be found in [Security Requirements for Smart Screen AVS](https://developer.amazon.com/en-US/docs/alexa/alexa-smart-screen-sdk/security-requirements.html).

## Important Considerations

Expand Down Expand Up @@ -94,9 +94,9 @@ You can pass any of them as an extra config file argument after the main Smart S

### Remote control support

Functionality for Exit and Back buttons (as found on a device's physical remote control) is minimally supported by the Smart Screen SDK. The following behaviors are expected to occur on execution of either a `BACK` or `EXIT` [navigationEvent](./modules/GUI/SDK-GUI-API#navigationevent):
Functionality for Exit and Back buttons (as found on a device's physical remote control) is minimally supported by the Smart Screen SDK. The following behaviors are expected to occur on execution of either a `BACK` or `EXIT` [navigationEvent](./modules/GUI/SDK-GUI-API.md#navigationevent):

* Clear the rendering screen - Exit fully out of the Alexa-presented display so that no static image or layout is left.
* Release the focus management - Release any focus management that might be held.

Using the default gui client configuration's [device keys](./modules/GUI/config/SmartScreenSDKConfig#device-keys-parameters), `Esc` and `B` are mapped to `EXIT` and `BACK` respectively.
Using the default gui client configuration's [device keys](./modules/GUI/config/SmartScreenSDKConfig.md#device-keys-parameters), `Esc` and `B` are mapped to `EXIT` and `BACK` respectively.
4 changes: 4 additions & 0 deletions modules/Alexa/APLClientLibrary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.vscode/
cmake-build-debug/
*.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class AplClientRenderer
/// @{
void onRenderDirectiveReceived(const std::chrono::steady_clock::time_point &receiveTime) override;
void onRenderingEvent(AplRenderingEvent event) override;
void onMetricsReported(const std::vector<DisplayMetric> &metrics) override;
void onMetricsReported(const std::string& jsonPayload) override;
void onTelemetrySinkUpdated(APLClient::Telemetry::AplMetricsSinkInterfacePtr sink) override;
/// @}

Expand All @@ -189,6 +189,14 @@ class AplClientRenderer
uint64_t m_lastReportedComplexity;

std::unique_ptr<Telemetry::AplTimerHandle> m_renderTimer;

/**
* Validates the content from the metrics payload
*
* @param jsonMetric The metric item to validate
* @return bool Indicates whether the metric content is valid
*/
bool validateJsonMetric(const rapidjson::Value& jsonMetric);
};

using AplClientRendererPtr = std::shared_ptr<AplClientRenderer>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <string>
#include <unordered_set>
#include <future>
// TODO: Tidy up core to prevent this (ARC-917)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreorder"
#pragma push_macro("DEBUG")
Expand Down Expand Up @@ -226,12 +225,24 @@ class AplCoreConnectionManager
*/
void sendScreenLockMessage(bool screenLock);

/**
* Sends supportsResizing state to the client
* @param screenLock
*/
void sendSupportsResizingMessage(bool supportsResizing);

/**
* Handles the build message received from the view host, builds the component hierarchy.
* @param message
*/
void handleBuild(const rapidjson::Value& message);

/**
* Handles the configuration change message from the view host and send to Core.
* @param message
*/
void handleConfigurationChange(const rapidjson::Value& message);

/**
* Handle an update message from the view host of the form:
*
Expand Down Expand Up @@ -277,6 +288,36 @@ class AplCoreConnectionManager
*/
void handleHandleKeyboard(const rapidjson::Value& payload);

/**
* Handle the setFocus message received from the viewhost
* @param payload
*/
void setFocus(const rapidjson::Value& payload);

/**
* Handle the getFocusableAreas message received from the viewhost
* @param payload
*/
void getFocusableAreas(const rapidjson::Value& payload);

/**
* Handle the getFocused message received from the viewhost
* @param payload
*/
void getFocused(const rapidjson::Value& payload);

/**
* Handle the getDisplayedChildCount message received from the viewhost
* @param payload
*/
void handleGetDisplayedChildCount(const rapidjson::Value& payload);

/**
* Handle the getDisplayedChildId message received from the viewhost
* @param payload
*/
void handleGetDisplayedChildId(const rapidjson::Value& payload);

/**
* Handle the updateCursorPosition message received from the viewhost
* @param payload
Expand Down Expand Up @@ -304,11 +345,23 @@ class AplCoreConnectionManager
void handleScreenLock();

/**
* Handle the isCharacterValid message received from viewhost
* Handle the isCharacterValid message received from ViewHost.
* @param payload
*/
void handleIsCharacterValid(const rapidjson::Value& payload);

/**
* Handle the reInflate message received from ViewHost.
* @param payload
*/
void handleReInflate(const rapidjson::Value& payload);

/**
* Handle the reHierarchy message received from ViewHost.
* @param payload
*/
void handleReHierarchy(const rapidjson::Value& payload);

/**
* Execute the event.
* ActionRefs have to be stored while we are waiting for a response.
Expand Down Expand Up @@ -424,6 +477,13 @@ class AplCoreConnectionManager
*/
void serializeJSONValueToString(const rapidjson::Value& documentNode, std::string* value);

/**
* Update the latest configurationChange which is maintained at device runtime.
*
* @param configurationChange the new reported configurationChange.
*/
void updateConfigurationChange(const apl::ConfigurationChange& configurationChange);

AplConfigurationPtr m_aplConfiguration;

/// View host message type to handler map
Expand All @@ -449,6 +509,9 @@ class AplCoreConnectionManager
*/
AplCoreMetricsPtr m_AplCoreMetrics;

/// Pointer to the latest configuration change object.
apl::ConfigurationChange m_ConfigurationChange = apl::ConfigurationChange();

/// Pointer to the APL Root Context
apl::RootContextPtr m_Root;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <string>

// TODO: Tidy up core to prevent this (ARC-917)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreorder"
#pragma push_macro("DEBUG")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#ifndef APL_CLIENT_LIBRARY_APL_CORE_GUI_RENDERER_H_
#define APL_CLIENT_LIBRARY_APL_CORE_GUI_RENDERER_H_

// TODO: Tidy up core to prevent this (ARC-917)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreorder"
#pragma push_macro("DEBUG")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 APLCLIENTLIBRARY_APLCORELOCALEMETHODS_H
#define APLCLIENTLIBRARY_APLCORELOCALEMETHODS_H

#include "AplConfiguration.h"
#include "AplCoreConnectionManager.h"
#include "Telemetry/AplMetricsRecorderInterface.h"

namespace APLClient {

class AplCoreLocaleMethods : public apl::LocaleMethods {
public:
/**
* Constructor
*
* @param aplCoreConnectionManager Pointer to the APL Core connection manager
*/
AplCoreLocaleMethods(
AplCoreConnectionManagerPtr aplCoreConnectionManager,
AplConfigurationPtr config);

std::string toLowerCase(const std::string &value, const std::string &locale) override;
std::string toUpperCase(const std::string &value, const std::string &locale) override;

private:
std::string toCase(const std::string &value, const std::string &locale, const std::string key);
std::weak_ptr<AplCoreConnectionManager> m_aplCoreConnectionManager;

AplConfigurationPtr m_aplConfiguration;
};

} // namespace APLClient
#endif //APLCLIENTLIBRARY_APLCORELOCALEMETHODS_H
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ class AplCoreMetrics : public apl::MetricsTransform {
* @return pixel height
*/
float getViewhostHeight() const override;

/**
* Converts px from VH to Core based on Scale.
* @param value
* @return
*/
float toCorePixel(float value);
};

using AplCoreMetricsPtr = std::shared_ptr<AplCoreMetrics>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#ifndef ALEXA_SMART_SCREEN_SDK_APPLICATIONUTILITIES_APL_APLCORETEXTMEASUREMENT_H
#define ALEXA_SMART_SCREEN_SDK_APPLICATIONUTILITIES_APL_APLCORETEXTMEASUREMENT_H

// TODO: Tidy up core to prevent this (ARC-917)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreorder"
#pragma push_macro("DEBUG")
Expand Down Expand Up @@ -67,8 +66,9 @@ class AplCoreTextMeasurement : public apl::TextMeasurement {
std::weak_ptr<AplCoreConnectionManager> m_aplCoreConnectionManager;

AplConfigurationPtr m_aplConfiguration;

std::unique_ptr<Telemetry::AplCounterHandle> m_textMeasureCounter;
apl::LayoutSize GetValidMeasureResult(rapidjson::Document& result, AplCoreMetrics* aplCoreMetrics );

};

} // namespace APLClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <vector>

#include "AplRenderingEvent.h"
#include "DisplayMetric.h"
#include "Telemetry/AplMetricsSinkInterface.h"

namespace APLClient {
Expand Down Expand Up @@ -51,9 +50,9 @@ class AplRenderingEventObserver {
/**
* Called when display metrics are reported by the viewhost.
*
* @param metrics the reported metrics
* @param jsonPayload the reported metrics payload
*/
virtual void onMetricsReported(const std::vector<DisplayMetric> &metrics) = 0;
virtual void onMetricsReported(const std::string& jsonPayload) = 0;

/**
* Called when the telemetry sink is updated.
Expand Down

This file was deleted.

Loading

0 comments on commit 9480393

Please sign in to comment.