From 47e04dab136aef830d3a3b4b14c0ac39bfa0ce5b Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Fri, 28 Sep 2018 16:24:37 -0700 Subject: [PATCH] Add finer grained call fail reasons. The "can dial" method does a lot of complicated checks which end up boiling down to a not so intuitive error to the user. Making this better. Test: Update unit test for can dial basic operation. Test: Manual test these scenarios. Bug: 73902028 Bug: 116453747 Change-Id: Ifdf681a1428c7cbb925cdf7f0c66c2d011c3d492 --- .../android/telephony/DisconnectCause.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java index ee5cdc2780db0..d7169b23d94b4 100644 --- a/telephony/java/android/telephony/DisconnectCause.java +++ b/telephony/java/android/telephony/DisconnectCause.java @@ -319,6 +319,29 @@ public class DisconnectCause { */ public static final int IMS_SIP_ALTERNATE_EMERGENCY_CALL = 71; + /** + * Indicates that a new outgoing call cannot be placed because there is already an outgoing + * call dialing out. + */ + public static final int ALREADY_DIALING = 72; + + /** + * Indicates that a new outgoing call cannot be placed while there is a ringing call. + */ + public static final int CANT_CALL_WHILE_RINGING = 73; + + /** + * Indicates that a new outgoing call cannot be placed because calling has been disabled using + * the ro.telephony.disable-call system property. + */ + public static final int CALLING_DISABLED = 74; + + /** + * Indicates that a new outgoing call cannot be placed because there is currently an ongoing + * foreground and background call. + */ + public static final int TOO_MANY_ONGOING_CALLS = 75; + //********************************************************************************************* // When adding a disconnect type: // 1) Update toString() with the newly added disconnect type. @@ -474,6 +497,14 @@ public class DisconnectCause { return "NORMAL_UNSPECIFIED"; case IMS_SIP_ALTERNATE_EMERGENCY_CALL: return "IMS_SIP_ALTERNATE_EMERGENCY_CALL"; + case ALREADY_DIALING: + return "ALREADY_DIALING"; + case CANT_CALL_WHILE_RINGING: + return "CANT_CALL_WHILE_RINGING"; + case CALLING_DISABLED: + return "CALLING_DISABLED"; + case TOO_MANY_ONGOING_CALLS: + return "TOO_MANY_ONGOING_CALLS"; default: return "INVALID: " + cause; }