Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba2912e0 authored by Jack Yu's avatar Jack Yu
Browse files

Added more descriptive data disallowed reasons

Splitted the vague APN_NOT_CONNECTABLE reason
with 3 more descriptive reasons DATA_IS_CONNECTING
, DATA_IS_DISCONNECTING, and DATA_ALREADY_CONNECTED

Test: Manual
Bug: 162007001
Merged-In: Ida1ea8d50c31b9c3b45e597aa52b366a17c487a6
Change-Id: Ida1ea8d50c31b9c3b45e597aa52b366a17c487a6
(cherry picked from commit 2a3ebb54)
parent b2944bf8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -113,7 +113,12 @@ public class DataConnectionReasons {
        UNDESIRED_POWER_STATE(true),
        INTERNAL_DATA_DISABLED(true),
        RADIO_DISABLED_BY_CARRIER(true),
        APN_NOT_CONNECTABLE(true),
        APN_NOT_CONNECTABLE(true),  // Not in the right state for data call setup.
        DATA_IS_CONNECTING(true),   // Data is in connecting state. No need to send another setup
                                    // request.
        DATA_IS_DISCONNECTING(true),    // Data is being disconnected. Telephony will retry after
                                        // disconnected.
        DATA_ALREADY_CONNECTED(true),   // Data is already connected. No need to setup data again.
        ON_IWLAN(true),
        IN_ECBM(true),
        ON_OTHER_TRANSPORT(true);   // When data retry occurs, the given APN type's preferred
+10 −1
Original line number Diff line number Diff line
@@ -1363,8 +1363,17 @@ public class DcTracker extends Handler {

        // Step 3. Build disallowed reasons.
        if (apnContext != null && !apnContext.isConnectable()) {
            DctConstants.State state = apnContext.getState();
            if (state == DctConstants.State.CONNECTED) {
                reasons.add(DataDisallowedReasonType.DATA_ALREADY_CONNECTED);
            } else if (state == DctConstants.State.DISCONNECTING) {
                reasons.add(DataDisallowedReasonType.DATA_IS_DISCONNECTING);
            } else if (state == DctConstants.State.CONNECTING) {
                reasons.add(DataDisallowedReasonType.DATA_IS_CONNECTING);
            } else {
                reasons.add(DataDisallowedReasonType.APN_NOT_CONNECTABLE);
            }
        }

        // In legacy mode, if RAT is IWLAN then don't allow default/IA PDP at all.
        // Rest of APN types can be evaluated for remaining conditions.