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

Namespaces

 test
 

Classes

struct  NotificationIndicator
 
class  NotificationRenderer
 
class  NotificationRendererInterface
 
class  NotificationRendererObserverInterface
 
class  NotificationsCapabilityAgent
 
class  NotificationsStorageInterface
 
class  SQLiteNotificationsStorage
 

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)
 
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 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"
 The key used to provide the "isVisualIndicatorPersisted" property in the state payload. More...
 
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 NotificationsStorageInterface::IndicatorState DEFAULT_INDICATOR_STATE
 

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

◆ getNotificationsCapabilityConfiguration()

std::shared_ptr< CapabilityConfiguration > alexaClientSDK::capabilityAgents::notifications::getNotificationsCapabilityConfiguration ( )
static

Creates the Notifications capability configuration.

Returns
The Notifications capability configuration.

◆ indicatorStateToInt()

int alexaClientSDK::capabilityAgents::notifications::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::capabilityAgents::notifications::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::capabilityAgents::notifications::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::capabilityAgents::notifications::operator<< ( std::ostream &  stream,
const NotificationsCapabilityAgentState state 
)
inline

◆ operator<<() [3/3]

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

◆ popNotificationIndicatorLocked()

static bool alexaClientSDK::capabilityAgents::notifications::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::capabilityAgents::notifications::stateToString ( NotificationsCapabilityAgentState  state)
inline

◆ submitMetric()

static void alexaClientSDK::capabilityAgents::notifications::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::capabilityAgents::notifications::TAG ( "NotificationRenderer"  )
static

String to identify log entries originating from this file.

◆ TAG() [2/3]

static const std::string alexaClientSDK::capabilityAgents::notifications::TAG ( "SQLiteNotificationsStorage"  )
static

String to identify log entries originating from this file.

◆ TAG() [3/3]

static const std::string alexaClientSDK::capabilityAgents::notifications::TAG ( "NotificationsCapabilityAgent"  )
static

String to identify log entries originating from this file.

Variable Documentation

◆ ASSET_ID_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::ASSET_ID_KEY = "assetId"
static

◆ ASSET_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::ASSET_KEY = "asset"
static

◆ ASSET_URL_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::ASSET_URL_KEY = "url"
static

◆ CHANNEL_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::CHANNEL_NAME = "Earcon"
static

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

◆ CLEAR_INDICATOR

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

The SetIndicator directive signature.

◆ CREATE_INDICATOR_STATE_TABLE_SQL_STRING

const std::string alexaClientSDK::capabilityAgents::notifications::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:65

◆ CREATE_NOTIFICATION_INDICATOR_TABLE_SQL_STRING

const std::string alexaClientSDK::capabilityAgents::notifications::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_ID_NAME
Definition: SQLiteNotificationsStorage.cpp:54
static const std::string DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME
Definition: SQLiteNotificationsStorage.cpp:52
static const std::string NOTIFICATION_INDICATOR_TABLE_NAME
Definition: SQLiteNotificationsStorage.cpp:48
static const std::string DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME
Definition: SQLiteNotificationsStorage.cpp:50
static const std::string DATABASE_COLUMN_ASSET_URL_NAME
Definition: SQLiteNotificationsStorage.cpp:56

◆ DATABASE_COLUMN_ASSET_ID_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::DATABASE_COLUMN_ASSET_ID_NAME = "assetId"
static

◆ DATABASE_COLUMN_ASSET_URL_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::DATABASE_COLUMN_ASSET_URL_NAME = "assetUrl"
static

◆ DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::DATABASE_COLUMN_PERSIST_VISUAL_INDICATOR_NAME = "persistVisualIndicator"
static

◆ DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::DATABASE_COLUMN_PLAY_AUDIO_INDICATOR_NAME = "playAudioIndicator"
static

◆ DEFAULT_INDICATOR_STATE

const NotificationsStorageInterface::IndicatorState alexaClientSDK::capabilityAgents::notifications::DEFAULT_INDICATOR_STATE
static
Initial value:
=
NotificationsStorageInterface::IndicatorState::OFF

◆ INDICATOR_STATE_CONTEXT_KEY

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

The NotificationsCapabilityAgent context state signature.

◆ INDICATOR_STATE_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::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::capabilityAgents::notifications::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::capabilityAgents::notifications::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::capabilityAgents::notifications::NAMESPACE = "NotificationRenderer"
static

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

◆ NAMESPACE [2/2]

const std::string alexaClientSDK::capabilityAgents::notifications::NAMESPACE = "Notifications"
static

The namespace for this capability agent.

◆ NOTIFICATION_INDICATOR_TABLE_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::NOTIFICATION_INDICATOR_TABLE_NAME = "notificationIndicators"
static

◆ NOTIFICATION_METRIC_SOURCE_PREFIX

const std::string alexaClientSDK::capabilityAgents::notifications::NOTIFICATION_METRIC_SOURCE_PREFIX = "NOTIFICATION-"
static

Metric Activity Name Prefix for NOTIFICATION metric source.

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_NAME

const std::string alexaClientSDK::capabilityAgents::notifications::NOTIFICATIONS_CAPABILITY_INTERFACE_NAME = "Notifications"
static

Notifications interface name.

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_TYPE

const std::string alexaClientSDK::capabilityAgents::notifications::NOTIFICATIONS_CAPABILITY_INTERFACE_TYPE = "AlexaInterface"
static

Notifications capability constants Notifications interface type

◆ NOTIFICATIONS_CAPABILITY_INTERFACE_VERSION

const std::string alexaClientSDK::capabilityAgents::notifications::NOTIFICATIONS_CAPABILITY_INTERFACE_VERSION = "1.0"
static

Notifications interface version.

◆ NOTIFICATIONS_CONFIGURATION_ROOT_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::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::capabilityAgents::notifications::NOTIFICATIONS_DB_FILE_PATH_KEY = "databaseFilePath"
static

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

◆ PERSIST_VISUAL_INDICATOR_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::PERSIST_VISUAL_INDICATOR_KEY = "persistVisualIndicator"
static

Keys for directive payload values.

◆ PLAY_AUDIO_INDICATOR_KEY

const std::string alexaClientSDK::capabilityAgents::notifications::PLAY_AUDIO_INDICATOR_KEY = "playAudioIndicator"
static

◆ SET_INDICATOR

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

The SetIndicator directive signature.

◆ SHUTDOWN_TIMEOUT

const std::chrono::milliseconds alexaClientSDK::capabilityAgents::notifications::SHUTDOWN_TIMEOUT {500}
static

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