File tree Expand file tree Collapse file tree
telecomm/java/android/telecom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38877,7 +38877,7 @@ package android.telecom {
3887738877
3887838878 public static final class Call.RttCall {
3887938879 method public int getRttAudioMode();
38880- method public java.lang.String read() throws java.io.IOException ;
38880+ method public java.lang.String read();
3888138881 method public java.lang.String readImmediately() throws java.io.IOException;
3888238882 method public void setRttMode(int);
3888338883 method public void write(java.lang.String) throws java.io.IOException;
Original file line number Diff line number Diff line change @@ -42122,7 +42122,7 @@ package android.telecom {
4212242122
4212342123 public static final class Call.RttCall {
4212442124 method public int getRttAudioMode();
42125- method public java.lang.String read() throws java.io.IOException ;
42125+ method public java.lang.String read();
4212642126 method public java.lang.String readImmediately() throws java.io.IOException;
4212742127 method public void setRttMode(int);
4212842128 method public void write(java.lang.String) throws java.io.IOException;
Original file line number Diff line number Diff line change @@ -39120,7 +39120,7 @@ package android.telecom {
3912039120
3912139121 public static final class Call.RttCall {
3912239122 method public int getRttAudioMode();
39123- method public java.lang.String read() throws java.io.IOException ;
39123+ method public java.lang.String read();
3912439124 method public java.lang.String readImmediately() throws java.io.IOException;
3912539125 method public void setRttMode(int);
3912639126 method public void write(java.lang.String) throws java.io.IOException;
Original file line number Diff line number Diff line change @@ -1089,12 +1089,17 @@ public void write(String input) throws IOException {
10891089 * @return A string containing text sent by the remote user, or {@code null} if the
10901090 * conversation has been terminated or if there was an error while reading.
10911091 */
1092- public String read () throws IOException {
1093- int numRead = mReceiveStream .read (mReadBuffer , 0 , READ_BUFFER_SIZE );
1094- if (numRead < 0 ) {
1092+ public String read () {
1093+ try {
1094+ int numRead = mReceiveStream .read (mReadBuffer , 0 , READ_BUFFER_SIZE );
1095+ if (numRead < 0 ) {
1096+ return null ;
1097+ }
1098+ return new String (mReadBuffer , 0 , numRead );
1099+ } catch (IOException e ) {
1100+ Log .w (this , "Exception encountered when reading from InputStreamReader: %s" , e );
10951101 return null ;
10961102 }
1097- return new String (mReadBuffer , 0 , numRead );
10981103 }
10991104
11001105 /**
@@ -1105,7 +1110,11 @@ public String read() throws IOException {
11051110 */
11061111 public String readImmediately () throws IOException {
11071112 if (mReceiveStream .ready ()) {
1108- return read ();
1113+ int numRead = mReceiveStream .read (mReadBuffer , 0 , READ_BUFFER_SIZE );
1114+ if (numRead < 0 ) {
1115+ return null ;
1116+ }
1117+ return new String (mReadBuffer , 0 , numRead );
11091118 } else {
11101119 return null ;
11111120 }
You can’t perform that action at this time.
0 commit comments