OSDN Git Service

Add ImsReason codes and DisconnectCauses for data disconnects.
authorTyler Gunn <tgunn@google.com>
Thu, 11 Aug 2016 20:13:51 +0000 (13:13 -0700)
committerTyler Gunn <tgunn@google.com>
Thu, 11 Aug 2016 20:13:51 +0000 (13:13 -0700)
Adding reason code and disconnect causes for:
1. disconnects due to user disabling data.
2. disconnects due to data limit being reached.

Bug: 30702393
Change-Id: Id6ea5ee4f5aac1a8602094315f893e2f7b3cc8d6

telephony/java/android/telephony/DisconnectCause.java
telephony/java/com/android/ims/ImsReasonInfo.java

index d7d4e84..f5e422d 100644 (file)
@@ -212,6 +212,20 @@ public class DisconnectCause {
      */
     public static final int MAXIMUM_NUMBER_OF_CALLS_REACHED = 53;
 
+    /**
+     * The call was terminated because cellular data has been disabled.
+     * Used when in a video call and the user disables cellular data via the settings.
+     * {@hide}
+     */
+    public static final int DATA_DISABLED = 54;
+
+    /**
+     * The call was terminated because the data policy has disabled cellular data.
+     * Used when in a video call and the user has exceeded the device data limit.
+     * {@hide}
+     */
+    public static final int DATA_LIMIT_REACHED = 55;
+
     //*********************************************************************************************
     // When adding a disconnect type:
     // 1) Please assign the new type the next id value below.
@@ -220,14 +234,14 @@ public class DisconnectCause {
     // 4) Update toString() with the newly added disconnect type.
     // 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause.
     //
-    // NextId: 54
+    // NextId: 56
     //*********************************************************************************************
 
     /** Smallest valid value for call disconnect codes. */
     public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED;
 
     /** Largest valid value for call disconnect codes. */
-    public static final int MAXIMUM_VALID_VALUE = MAXIMUM_NUMBER_OF_CALLS_REACHED;
+    public static final int MAXIMUM_VALID_VALUE = DATA_LIMIT_REACHED;
 
     /** Private constructor to avoid class instantiation. */
     private DisconnectCause() {
@@ -343,6 +357,10 @@ public class DisconnectCause {
             return "ANSWERED_ELSEWHERE";
         case MAXIMUM_NUMBER_OF_CALLS_REACHED:
             return "MAXIMUM_NUMER_OF_CALLS_REACHED";
+        case DATA_DISABLED:
+            return "DATA_DISABLED";
+        case DATA_LIMIT_REACHED:
+            return "DATA_LIMIT_REACHED";
         default:
             return "INVALID: " + cause;
         }
index 408ad31..56b8822 100644 (file)
@@ -298,6 +298,16 @@ public class ImsReasonInfo implements Parcelable {
     public static final int CODE_REMOTE_CALL_DECLINE = 1404;
 
     /**
+     * Indicates the call was disconnected due to the user reaching their data limit.
+     */
+    public static final int CODE_DATA_LIMIT_REACHED = 1405;
+
+    /**
+     * Indicates the call was disconnected due to the user disabling cellular data.
+     */
+    public static final int CODE_DATA_DISABLED = 1406;
+
+    /**
      * Network string error messages.
      * mExtraMessage may have these values.
      */