AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
alexaClientSDK::acsdkNotifications Namespace Reference

Namespaces

 test
 

Classes

struct  NotificationIndicator
 
class  NotificationRenderer
 
class  NotificationsCapabilityAgent
 
class  NotificationsNotifier
 
class  SQLiteNotificationsStorage
 

Typedefs

using NotificationsComponent = acsdkManufactory::Component< std::shared_ptr< acsdkNotificationsInterfaces::NotificationsNotifierInterface >, acsdkManufactory::Import< std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > >, acsdkManufactory::Import< std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > >, acsdkManufactory::Import< std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > >, acsdkManufactory::Import< std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > >, acsdkManufactory::Import< std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > >, acsdkManufactory::Import< acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > >, acsdkManufactory::Import< std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > >, acsdkManufactory::Import< std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > >, acsdkManufactory::Import< acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > >, acsdkManufactory::Import< std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > >, acsdkManufactory::Import< std::shared_ptr< registrationManager::CustomerDataManagerInterface > >>
 

Enumerations

enum  IndicatorState { IndicatorState::OFF = 0, IndicatorState::ON = 1, IndicatorState::UNDEFINED }
 
enum  NotificationsCapabilityAgentState {
  NotificationsCapabilityAgentState::IDLE, NotificationsCapabilityAgentState::PLAYING, NotificationsCapabilityAgentState::CANCELING_PLAY, NotificationsCapabilityAgentState::SHUTTING_DOWN,
  NotificationsCapabilityAgentState::SHUTDOWN
}
 

Functions

int indicatorStateToInt (IndicatorState state)
 
const IndicatorState intToIndicatorState (int stateNum)
 
std::ostream & operator<< (std::ostream &stream, IndicatorState state)
 
std::string stateToString (NotificationsCapabilityAgentState state)
 
std::ostream & operator<< (std::ostream &stream, const NotificationsCapabilityAgentState &state)
 
NotificationsComponent getComponent ()
 
static const std::string TAG ("NotificationRenderer")
 String to identify log entries originating from this file. More...
 
std::ostream & operator<< (std::ostream &stream, const NotificationRenderer::State state)
 
static const std::string TAG ("NotificationsCapabilityAgent")
 String to identify log entries originating from this file. More...
 
static std::shared_ptr< avsCommon::avs::CapabilityConfigurationgetNotificationsCapabilityConfiguration ()
 
static void submitMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, const std::string &eventName)
 
static const std::string TAG ("SQLiteNotificationsStorage")
 String to identify log entries originating from this file. More...
 
static bool popNotificationIndicatorLocked (SQLiteDatabase *database)
 

Variables

static const constexpr char * NOTIFICATIONS_MEDIA_PLAYER_NAME = "NotificationsMediaPlayer"
 String to identify the notifications media player to render audio. More...
 
static const std::string CHANNEL_NAME = "Earcon"
 String to identify the name of the Virtual Audio Channel "Earcon". More...
 
static const std::string NAMESPACE = "NotificationRenderer"
 String to identify the namespace this CapabilityAgent uses to acquire focus. More...
 
static const std::string NOTIFICATIONS_CAPABILITY_INTERFACE_TYPE = "AlexaInterface"
 
static const std::string NOTIFICATIONS_CAPABILITY_INTERFACE_NAME = "Notifications"
 Notifications interface name. More...
 
static const std::string NOTIFICATIONS_CAPABILITY_INTERFACE_VERSION = "1.0"
 Notifications interface version. More...
 
static const std::string NAMESPACE = "Notifications"
 The namespace for this capability agent. More...
 
static const std::string NOTIFICATION_METRIC_SOURCE_PREFIX = "NOTIFICATION-"
 Metric Activity Name Prefix for NOTIFICATION metric source. More...
 
static const NamespaceAndName INDICATOR_STATE_CONTEXT_KEY {NAMESPACE, "IndicatorState"}
 The NotificationsCapabilityAgent context state signature. More...
 
static const NamespaceAndName SET_INDICATOR {NAMESPACE, "SetIndicator"}
 The SetIndicator directive signature. More...
 
static const NamespaceAndName CLEAR_INDICATOR {NAMESPACE, "ClearIndicator"}
 The SetIndicator directive signature. More...
 
static const std::string PERSIST_VISUAL_INDICATOR_KEY = "persistVisualIndicator"
 Keys for directive payload values. More...
 
static const std::string PLAY_AUDIO_INDICATOR_KEY = "playAudioIndicator"
 
static const std::string ASSET_KEY = "asset"
 
static const std::string ASSET_ID_KEY = "assetId"
 
static const std::string ASSET_URL_KEY = "url"
 
static const char IS_ENABLED_KEY [] = "isEnabled"
 The key used to provide the "isEnabled" property in the state payload. More...
 
static const char IS_VISUAL_INDICATOR_PERSISTED_KEY [] = "isVisualIndicatorPersisted"
 
static const std::chrono::milliseconds SHUTDOWN_TIMEOUT {500}
 
static const std::string NOTIFICATIONS_CONFIGURATION_ROOT_KEY = "notifications"
 The key in our config file to find the root of settings. More...
 
static const std::string NOTIFICATIONS_DB_FILE_PATH_KEY = "databaseFilePath"
 The key in our config file to find the database file path. More...
 
static const std::string NOTIFICATION_INDICATOR_TABLE_NAME = "notificationIndicators"
 
static const std::string DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME = "persistVisualIndicator"
 
static const std::string DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME = "playAudioIndicator"
 
static const std::string DATABASE_COLUMN_ASSET_ID_NAME = "assetId"
 
static const std::string DATABASE_COLUMN_ASSET_URL_NAME = "assetUrl"
 
static const std::string CREATE_NOTIFICATION_INDICATOR_TABLE_SQL_STRING
 
static const std::string INDICATOR_STATE_NAME = "indicatorState"
 The name of the table and the field that will hold the state of the indicator. More...
 
static const std::string CREATE_INDICATOR_STATE_TABLE_SQL_STRING
 
static const acsdkNotificationsInterfaces::NotificationsStorageInterface::IndicatorState DEFAULT_INDICATOR_STATE
 

Typedef Documentation

◆ NotificationsComponent

Definition of a Manufactory Component for Notifications.

Enumeration Type Documentation

◆ IndicatorState

An enum class used to represent the state of the notification indicator.

Note
These values shouldn't be changed before evaluating the effect a change will have on existing databases.
Enumerator
OFF 
ON 
UNDEFINED 

◆ NotificationsCapabilityAgentState

Enumerator
IDLE 
PLAYING 
CANCELING_PLAY 
SHUTTING_DOWN 
SHUTDOWN 

Function Documentation

◆ getComponent()

NotificationsComponent alexaClientSDK::acsdkNotifications::getComponent ( )

Creates an manufactory component that exports a NotificationsNotifierInterface.

Returns
A component.

◆ getNotificationsCapabilityConfiguration()

std::shared_ptr< CapabilityConfiguration > alexaClientSDK::acsdkNotifications::getNotificationsCapabilityConfiguration ( )
static

Creates the Notifications capability configuration.

Returns
The Notifications capability configuration.

◆ indicatorStateToInt()

int alexaClientSDK::acsdkNotifications::indicatorStateToInt ( IndicatorState  state)
inline

Convert an IndicatorState to an int.

Parameters
stateThe IndicatorState to convert.
Returns
The int representation of state

◆ intToIndicatorState()

const IndicatorState alexaClientSDK::acsdkNotifications::intToIndicatorState ( int  stateNum)
inline

Convert an int into an IndicatorState.

Parameters
stateNumThe int to convert.
Returns
The IndicatorState representation of stateNum or nullptr if stateNum is invalid.

◆ operator<<() [1/3]

std::ostream& alexaClientSDK::acsdkNotifications::operator<< ( std::ostream &  stream,
const NotificationRenderer::State  state 
)

Emit a NotificationRenderer::State value to a stream.

Parameters
streamThe stream to emit the value to.
stateThe state to emit.
Returns
The stream that was emitted to, allowing chained stream operators.

◆ operator<<() [2/3]

std::ostream& alexaClientSDK::acsdkNotifications::operator<< ( std::ostream &  stream,
const NotificationsCapabilityAgentState state 
)
inline

◆ operator<<() [3/3]

std::ostream& alexaClientSDK::acsdkNotifications::operator<< ( std::ostream &  stream,
IndicatorState  state 
)
inline

◆ popNotificationIndicatorLocked()

static bool alexaClientSDK::acsdkNotifications::popNotificationIndicatorLocked ( SQLiteDatabase database)
static

A utility function to pop the next notificationIndicator from the database.

Parameters
databasePounter to the database.
Returns
Whether the delete operation was successful.
Note
This function should only be called when holding m_databaseMutex.

◆ stateToString()

std::string alexaClientSDK::acsdkNotifications::stateToString ( NotificationsCapabilityAgentState  state)
inline

◆ submitMetric()

static void alexaClientSDK::acsdkNotifications::submitMetric ( const std::shared_ptr< MetricRecorderInterface > &  metricRecorder,
const std::string &  eventName 
)
static

Submits a metric count of 1 by name

Parameters
metricRecorderThe MetricRecorderInterface which records Metric events
eventNameThe name of the metric event

◆ TAG() [1/3]

static const std::string alexaClientSDK::acsdkNotifications::TAG ( "SQLiteNotificationsStorage"  )
static

String to identify log entries originating from this file.

◆ TAG() [2/3]

static const std::string alexaClientSDK::acsdkNotifications::TAG ( "NotificationRenderer"  )
static

String to identify log entries originating from this file.

◆ TAG() [3/3]

static const std::string alexaClientSDK::acsdkNotifications::TAG ( "NotificationsCapabilityAgent"  )
static

String to identify log entries originating from this file.

Variable Documentation

◆ ASSET_ID_KEY

const std::string alexaClientSDK::acsdkNotifications::ASSET_ID_KEY = "assetId"
static

◆ ASSET_KEY

const std::string alexaClientSDK::acsdkNotifications::ASSET_KEY = "asset"
static

◆ ASSET_URL_KEY

const std::string alexaClientSDK::acsdkNotifications::ASSET_URL_KEY = "url"
static

◆ CHANNEL_NAME

const std::string alexaClientSDK::acsdkNotifications::CHANNEL_NAME = "Earcon"
static

String to identify the name of the Virtual Audio Channel "Earcon".

◆ CLEAR_INDICATOR

const NamespaceAndName alexaClientSDK::acsdkNotifications::CLEAR_INDICATOR {NAMESPACE, "ClearIndicator"}
static

The SetIndicator directive signature.

◆ CREATE_INDICATOR_STATE_TABLE_SQL_STRING

const std::string alexaClientSDK::acsdkNotifications::CREATE_INDICATOR_STATE_TABLE_SQL_STRING
static
Initial value:
=
std::string("CREATE TABLE ") + INDICATOR_STATE_NAME + " (" + INDICATOR_STATE_NAME + " INT NOT NULL);"
static const std::string INDICATOR_STATE_NAME
The name of the table and the field that will hold the state of the indicator.
Definition: SQLiteNotificationsStorage.cpp:64

◆ CREATE_NOTIFICATION_INDICATOR_TABLE_SQL_STRING

const std::string alexaClientSDK::acsdkNotifications::CREATE_NOTIFICATION_INDICATOR_TABLE_SQL_STRING
static
Initial value:
=
std::string("CREATE TABLE ") + NOTIFICATION_INDICATOR_TABLE_NAME + " (" +
" INT NOT NULL," + DATABASE_COLUMN_ASSET_ID_NAME + " TEXT NOT NULL," + DATABASE_COLUMN_ASSET_URL_NAME +
" TEXT NOT NULL);"
static const std::string DATABASE_COLUMN_ASSET_URL_NAME
Definition: SQLiteNotificationsStorage.cpp:55
static const std::string DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME
Definition: SQLiteNotificationsStorage.cpp:49
static const std::string DATABASE_COLUMN_ASSET_ID_NAME
Definition: SQLiteNotificationsStorage.cpp:53
static const std::string NOTIFICATION_INDICATOR_TABLE_NAME
Definition: SQLiteNotificationsStorage.cpp:47
static const std::string DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME
Definition: SQLiteNotificationsStorage.cpp:51

◆ DATABASE_COLUMN_ASSET_ID_NAME

const std::string alexaClientSDK::acsdkNotifications::DATABASE_COLUMN_ASSET_ID_NAME = "assetId"
static

◆ DATABASE_COLUMN_ASSET_URL_NAME

const std::string alexaClientSDK::acsdkNotifications::DATABASE_COLUMN_ASSET_URL_NAME = "assetUrl"
static

◆ DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME

const std::string alexaClientSDK::acsdkNotifications::DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME = "persistVisualIndicator"
static

◆ DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME

const std::string alexaClientSDK::acsdkNotifications::DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME = "playAudioIndicator"
static

◆ DEFAULT_INDICATOR_STATE

const acsdkNotificationsInterfaces::NotificationsStorageInterface::IndicatorState alexaClientSDK::acsdkNotifications::DEFAULT_INDICATOR_STATE
static
Initial value:
=
acsdkNotificationsInterfaces::NotificationsStorageInterface::IndicatorState::OFF

◆ INDICATOR_STATE_CONTEXT_KEY

const NamespaceAndName alexaClientSDK::acsdkNotifications::INDICATOR_STATE_CONTEXT_KEY {NAMESPACE, "IndicatorState"}
static

The NotificationsCapabilityAgent context state signature.

◆ INDICATOR_STATE_NAME

const std::string alexaClientSDK::acsdkNotifications::INDICATOR_STATE_NAME = "indicatorState"
static

The name of the table and the field that will hold the state of the indicator.

◆ IS_ENABLED_KEY

const char alexaClientSDK::acsdkNotifications::IS_ENABLED_KEY[] = "isEnabled"
static

The key used to provide the "isEnabled" property in the state payload.

◆ IS_VISUAL_INDICATOR_PERSISTED_KEY

const char alexaClientSDK::acsdkNotifications::IS_VISUAL_INDICATOR_PERSISTED_KEY[] = "isVisualIndicatorPersisted"
static

The key used to provide the "isVisualIndicatorPersisted" property in the state payload.

◆ NAMESPACE [1/2]

const std::string alexaClientSDK::acsdkNotifications::NAMESPACE = "NotificationRenderer"
static

String to identify the namespace this CapabilityAgent uses to acquire focus.

◆ NAMESPACE [2/2]

const std::string alexaClientSDK::acsdkNotifications::NAMESPACE = "Notifications"
static

The namespace for this capability agent.

◆ NOTIFICATION_INDICATOR_TABLE_NAME

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATION_INDICATOR_TABLE_NAME = "notificationIndicators"
static

◆ NOTIFICATION_METRIC_SOURCE_PREFIX

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATION_METRIC_SOURCE_PREFIX = "NOTIFICATION-"
static

Metric Activity Name Prefix for NOTIFICATION metric source.

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_NAME

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATIONS_CAPABILITY_INTERFACE_NAME = "Notifications"
static

Notifications interface name.

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_TYPE

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATIONS_CAPABILITY_INTERFACE_TYPE = "AlexaInterface"
static

Notifications capability constants Notifications interface type

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_VERSION

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATIONS_CAPABILITY_INTERFACE_VERSION = "1.0"
static

Notifications interface version.

◆ NOTIFICATIONS_CONFIGURATION_ROOT_KEY

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATIONS_CONFIGURATION_ROOT_KEY = "notifications"
static

The key in our config file to find the root of settings.

◆ NOTIFICATIONS_DB_FILE_PATH_KEY

const std::string alexaClientSDK::acsdkNotifications::NOTIFICATIONS_DB_FILE_PATH_KEY = "databaseFilePath"
static

The key in our config file to find the database file path.

◆ NOTIFICATIONS_MEDIA_PLAYER_NAME

const constexpr char* alexaClientSDK::acsdkNotifications::NOTIFICATIONS_MEDIA_PLAYER_NAME = "NotificationsMediaPlayer"
static

String to identify the notifications media player to render audio.

◆ PERSIST_VISUAL_INDICATOR_KEY

const std::string alexaClientSDK::acsdkNotifications::PERSIST_VISUAL_INDICATOR_KEY = "persistVisualIndicator"
static

Keys for directive payload values.

◆ PLAY_AUDIO_INDICATOR_KEY

const std::string alexaClientSDK::acsdkNotifications::PLAY_AUDIO_INDICATOR_KEY = "playAudioIndicator"
static

◆ SET_INDICATOR

const NamespaceAndName alexaClientSDK::acsdkNotifications::SET_INDICATOR {NAMESPACE, "SetIndicator"}
static

The SetIndicator directive signature.

◆ SHUTDOWN_TIMEOUT

const std::chrono::milliseconds alexaClientSDK::acsdkNotifications::SHUTDOWN_TIMEOUT {500}
static

AlexaClientSDK 1.25.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0