Added in API level 28

RttTextStream


class RttTextStream
kotlin.Any
   ↳ android.telecom.Connection.RttTextStream

Provides methods to read and write RTT data to/from the in-call app.

Summary

Public methods
String!

Reads a string from the in-call app, blocking if there is no data available.

String!

Non-blocking version of read().

Unit
write(input: String!)

Writes the string {@param input} into the text stream to the UI for this RTT call.

Public methods

read

Added in API level 28
fun read(): String!

Reads a string from the in-call app, blocking if there is no data available. Returns null if the RTT conversation has been terminated and there is no further data to read.

This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.

Return
String! A string containing text entered by the user, or null if the conversation has been terminated or if there was an error while reading.

readImmediately

Added in API level 28
fun readImmediately(): String!

Non-blocking version of read(). Returns null if there is nothing to be read.

Return
String! A string containing text entered by the user, or null if the user has not entered any new text yet.

write

Added in API level 28
fun write(input: String!): Unit

Writes the string {@param input} into the text stream to the UI for this RTT call. Since RTT transmits text in real-time, this method should be called as often as text snippets are received from the remote user, even if it is only one character.

This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.

Parameters
input String!: The message to send to the in-call app.