Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d33be525 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Do not throw IOException from RttCall.read()" into oc-mr1-dev

parents fac2141f b1c8a77f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38877,7 +38877,7 @@ package android.telecom {
  public static final class Call.RttCall {
    method public int getRttAudioMode();
    method public java.lang.String read() throws java.io.IOException;
    method public java.lang.String read();
    method public java.lang.String readImmediately() throws java.io.IOException;
    method public void setRttMode(int);
    method public void write(java.lang.String) throws java.io.IOException;
+1 −1
Original line number Diff line number Diff line
@@ -42122,7 +42122,7 @@ package android.telecom {
  public static final class Call.RttCall {
    method public int getRttAudioMode();
    method public java.lang.String read() throws java.io.IOException;
    method public java.lang.String read();
    method public java.lang.String readImmediately() throws java.io.IOException;
    method public void setRttMode(int);
    method public void write(java.lang.String) throws java.io.IOException;
+1 −1
Original line number Diff line number Diff line
@@ -39120,7 +39120,7 @@ package android.telecom {
  public static final class Call.RttCall {
    method public int getRttAudioMode();
    method public java.lang.String read() throws java.io.IOException;
    method public java.lang.String read();
    method public java.lang.String readImmediately() throws java.io.IOException;
    method public void setRttMode(int);
    method public void write(java.lang.String) throws java.io.IOException;
+14 −5
Original line number Diff line number Diff line
@@ -1089,12 +1089,17 @@ 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() throws IOException {
        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);
                return null;
            }
        }

        /**
@@ -1105,7 +1110,11 @@ public final class Call {
         */
        public String readImmediately() throws IOException {
            if (mReceiveStream.ready()) {
                return read();
                int numRead = mReceiveStream.read(mReadBuffer, 0, READ_BUFFER_SIZE);
                if (numRead < 0) {
                    return null;
                }
                return new String(mReadBuffer, 0, numRead);
            } else {
                return null;
            }