Connection.RttTextStream
public
static
final
class
Connection.RttTextStream
extends Object
java.lang.Object | |
↳ | android.telecom.Connection.RttTextStream |
Provides methods to read and write RTT data to/from the in-call app.
Summary
Public methods | |
---|---|
String
|
read()
Reads a string from the in-call app, blocking if there is no data available. |
String
|
readImmediately()
Non-blocking version of |
void
|
write(String input)
Writes the string into the text stream to the UI for this RTT call. |
Inherited methods | |
---|---|
Public methods
read
public String read ()
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.
Returns | |
---|---|
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. |
Throws | |
---|---|
IOException |
readImmediately
public String readImmediately ()
Non-blocking version of read()
. Returns null
if there is nothing to
be read.
Returns | |
---|---|
String |
A string containing text entered by the user, or null if the user has
not entered any new text yet. |
Throws | |
---|---|
IOException |
write
public void write (String input)
Writes the string 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.
Throws | |
---|---|
IOException |