summaryrefslogtreecommitdiffstats
path: root/sip
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-11-08 21:46:32 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-11-08 21:46:32 +0000
commitd19b83390c719fe8c5dd4e6bbc343b6d83131838 (patch)
treee1c49cccdd6db6c983eb5ec994b50236c526c142 /sip
parent1f01a4301847187bcc2f975ecc0a984a4188c036 (diff)
parenteb72c560946a61853b15cb96bba83957d948b6d4 (diff)
downloadandroid_packages_services_Telephony-d19b83390c719fe8c5dd4e6bbc343b6d83131838.tar.gz
android_packages_services_Telephony-d19b83390c719fe8c5dd4e6bbc343b6d83131838.tar.bz2
android_packages_services_Telephony-d19b83390c719fe8c5dd4e6bbc343b6d83131838.zip
Catch SIP exceptions which can crash Phone process on answer.
am: eb72c56094 Change-Id: Ic001a32d0a6c70bf7d4688f1d41a6e41919a8e85
Diffstat (limited to 'sip')
-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();
}
}