CarMessage


@CarProtocol
@RequiresCarApi(value = 7)
class CarMessage


Represents a single message in a ConversationItem

Summary

Nested types

A builder for CarMessage

Public functions

Boolean
equals(other: Any?)
CarText?

Returns a CarText representing the message body

String?

Returns a String representing the MIME type of a multimedia message

Uri?

Returns a Uri pointing to the contents of a multimedia message.

Long

Returns a long representing the message timestamp (in epoch millis)

Person?

Returns a Person representing the message sender.

Int
Boolean

Returns a boolean, indicating whether the message has been read

Public functions

equals

fun equals(other: Any?): Boolean

getBody

Added in 1.3.0
fun getBody(): CarText?

Returns a CarText representing the message body

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

getMultimediaMimeType

Added in 1.4.0
fun getMultimediaMimeType(): String?

Returns a String representing the MIME type of a multimedia message

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

getMultimediaUri

Added in 1.4.0
fun getMultimediaUri(): Uri?

Returns a Uri pointing to the contents of a multimedia message.

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

getReceivedTimeEpochMillis

Added in 1.3.0
fun getReceivedTimeEpochMillis(): Long

Returns a long representing the message timestamp (in epoch millis)

getSender

Added in 1.3.0
fun getSender(): Person?

Returns a Person representing the message sender.

For self-sent messages, this method will return null or getSelf.

hashCode

fun hashCode(): Int

isRead

Added in 1.3.0
fun isRead(): Boolean

Returns a boolean, indicating whether the message has been read