Interface IMessage
interface IMessage
Extends com.amazon.apmf.IStandard
Message.
Corresponds to a specific message handle. Message attributes are
retrieved from the remote device message repository when a getter is
invoked for the first time, which blocks until the message is
retrieved.
Methods
setReadStatus()
Set the read status of the message. This is a blocking call until the remote device message repository has updated the read status. Privilege: com.amazon.bluetooth.privilege.message_clientvoidsetReadStatus(boolread)
Parameters
read
bool — Required
True for read, False for unread.
Throws
BluetoothNotConnected— if message repository is not connected.BluetoothFail— if failed to set status.TimeoutError— if operation timed out.
setDeletedStatus()
Set the deleted status of the message. Messages whose deleted status is changed to deleted are moved to the “Deleted” folder. Messages whose deleted status is changed to undeleted are moved first to the “Inbox” folder. The message repository might move the message again back to its original folder before deletion. This is a blocking call until the remote device message repository has updated the deleted status. Privilege: com.amazon.bluetooth.privilege.message_clientvoidsetDeletedStatus(booldeleted)
Parameters
deleted
bool — Required
True for deleted, false for undeleted.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if failed to set status.TimeoutError— if operation timed out.
getOriginator()
Get message originator. The message originator is the original sender of the message. Privilege: com.amazon.bluetooth.privilege.message_clientMessageContact*getOriginator()
Returns
MessageContact*
Returns a pointer to MessageContact.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.OutOfMemoryError— if failed to make MessageContact.
getRecipients()
Get message recipients. Privilege: com.amazon.bluetooth.privilege.message_clientMessageContact*[]getRecipients()
Returns
MessageContact*[]
Returns an array of MessageContact.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.OutOfMemoryError— if failed to make array of MessageContact.
isRead()
bool isRead()
Get message is read.
Indicates whether the message is read or not. The initial status
is read if the message has already been read on the remote device.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
bool
Returns true if read, false if unread.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.
getType()
MessageType getType()
Get message type.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
MessageType
Returns MessageType.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.
getFolder()
string getFolder()
Get message folder.
The folder is where the message is located in the message
repository. This also includes the path information.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
string
Returns the folder string
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.OutOfMemoryError— if failed to make string.
getCharset()
MessageCharset getCharset()
Get message character set.
Indicates the character set used by the message contents. Only
used if the message contains textual content.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
MessageCharset
Returns MessageCharset.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.
getEncoding()
MessageEncoding getEncoding()
Get message encoding.
Indicates the encoding used by the message contents.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
MessageEncoding
Returns MessageEncoding.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.
getLanguage()
MessageLanguage getLanguage()
Get message language.
Indicates the language of the message. Only used if the message
contains textual content.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
MessageLanguage
Returns MessageLanguage.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.
getContent()
u8[] getContent()
Get message contents.
Privilege: com.amazon.bluetooth.privilege.message_client
Returns
u8[]
Returns message contents as array of bytes.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if not specified.TimeoutError— if operation timed out.OutOfMemoryError— if failed to make array of bytes.

