summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-11-02 14:46:34 -0700
committergitbuildkicker <android-build@google.com>2017-01-03 15:08:46 -0800
commit38b45bbcc18b77e947e8bb8b9ee7b3fe5c1d0d6f (patch)
tree549a7b7ad3b489f3ac6cb66cf7de986650ebf903
parentc8f5e04f8c3d8ce54e5094a0281d57ba8bfaa782 (diff)
downloadTelephony-nougat-mr1.2-release.tar.gz
Catch SIP exceptions which can crash Phone process on answer.android-7.1.1_r28android-7.1.1_r17android-7.1.1_r13nougat-mr1.2-release
There are two exceptions which can be raised when answering a call which can cause the Phone process to crash on answer. 1. IllegalStateException due to answering a call with an incompatible codec. 2. IllegalArgumentException due to answering a call with a malformed SDP. In both of these cases we catch the exception and reject the call to stop it from ringing (otherwise it will keep ringing and the user will not be able to stop it). The existing CallStateException does not require onReject to be called as it is thrown when the call has already been disconnected before it can be answered. Test: Manual (see bug) Bug: 31752213 Change-Id: I5254fd3a27b86fdc70889ea0a2b5be3b699fd9f5 (cherry picked from commit 06a98183cc79dd112d9d33cf027977a9d5d3418a) (cherry picked from commit eb72c560946a61853b15cb96bba83957d948b6d4)
-rw-r--r--sip/src/com/android/services/telephony/sip/SipConnection.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/sip/src/com/android/services/telephony/sip/SipConnection.java b/sip/src/com/android/services/telephony/sip/SipConnection.java
index b10ae568f..2dde5b56f 100644
--- a/sip/src/com/android/services/telephony/sip/SipConnection.java
+++ b/sip/src/com/android/services/telephony/sip/SipConnection.java
@@ -24,6 +24,7 @@ import android.telecom.AudioState;
import android.telecom.Connection;
import android.telecom.PhoneAccount;
import android.telecom.TelecomManager;
+import android.util.EventLog;
import android.util.Log;
import com.android.internal.telephony.Call;
@@ -181,6 +182,18 @@ final class SipConnection extends Connection {
}
} catch (CallStateException e) {
log("onAnswer, exception: " + e);
+ } catch (IllegalStateException e) {
+ // Call could not be answered due to an invalid audio-codec offered by the caller. We
+ // will reject the call to stop it from ringing.
+ log("onAnswer, IllegalStateException: " + e);
+ EventLog.writeEvent(0x534e4554, "31752213", -1, "Invalid codec.");
+ onReject();
+ } catch (IllegalArgumentException e) {
+ // Call could not be answered due to an error parsing the SDP. We will reject the call
+ // to stop it from ringing.
+ log("onAnswer, IllegalArgumentException: " + e);
+ EventLog.writeEvent(0x534e4554, "31752213", -1, "Invalid SDP.");
+ onReject();
}
}