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

Commit 2c895a2d authored by Jack Yu's avatar Jack Yu
Browse files

Fixed that data retry on non-serviced transport

When data retry occurs, the APN's prefered transport might
be already changed. If the current transport is not preferred,
we should not allow data setup (except for handover case).

Bug: 136278647
Test: Manual
Change-Id: I46b455ea5b0ebcf2bdfbe3f0ace60d65e747f007
parent 1ffcd871
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -115,7 +115,10 @@ public class DataConnectionReasons {
        RADIO_DISABLED_BY_CARRIER(true),
        APN_NOT_CONNECTABLE(true),
        ON_IWLAN(true),
        IN_ECBM(true);
        IN_ECBM(true),
        ON_OTHER_TRANSPORT(true);   // When data retry occurs, the given APN type's preferred
                                    // transport might be already changed. In this case we
                                    // should disallow data retry.

        private boolean mIsHardReason;

+10 −0
Original line number Diff line number Diff line
@@ -1351,6 +1351,16 @@ public class DcTracker extends Handler {
            reasons.add(DataDisallowedReasonType.RADIO_DISABLED_BY_CARRIER);
        }

        if (apnContext != null) {
            // If the transport has been already switched to the other transport, we should not
            // allow the data setup. The only exception is the handover case, where we setup
            // handover data connection before switching the transport.
            if (mTransportType != mPhone.getTransportManager().getCurrentTransport(
                    apnContext.getApnTypeBitmask()) && requestType != REQUEST_TYPE_HANDOVER) {
                reasons.add(DataDisallowedReasonType.ON_OTHER_TRANSPORT);
            }
        }

        boolean isDataEnabled = apnContext == null ? mDataEnabledSettings.isDataEnabled()
                : mDataEnabledSettings.isDataEnabled(apnContext.getApnTypeBitmask());