Merge "Add @TestApi annotations to CS-side RTT APIs for CTS"
This commit is contained in:
@ -1001,15 +1001,24 @@ public final class Call {
|
||||
* @return A string containing text sent by the remote user, or {@code null} if the
|
||||
* conversation has been terminated or if there was an error while reading.
|
||||
*/
|
||||
public String read() {
|
||||
try {
|
||||
int numRead = mReceiveStream.read(mReadBuffer, 0, READ_BUFFER_SIZE);
|
||||
if (numRead < 0) {
|
||||
return null;
|
||||
}
|
||||
return new String(mReadBuffer, 0, numRead);
|
||||
} catch (IOException e) {
|
||||
Log.w(this, "Exception encountered when reading from InputStreamReader: %s", e);
|
||||
public String read() throws IOException {
|
||||
int numRead = mReceiveStream.read(mReadBuffer, 0, READ_BUFFER_SIZE);
|
||||
if (numRead < 0) {
|
||||
return null;
|
||||
}
|
||||
return new String(mReadBuffer, 0, numRead);
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-blocking version of {@link #read()}. Returns {@code null} if there is nothing to
|
||||
* be read.
|
||||
* @return A string containing text entered by the user, or {@code null} if the user has
|
||||
* not entered any new text yet.
|
||||
*/
|
||||
public String readImmediately() throws IOException {
|
||||
if (mReceiveStream.ready()) {
|
||||
return read();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user