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

Commit 1e9bc601 authored by Chen Xu's avatar Chen Xu Committed by Android (Google) Code Review
Browse files

Merge "shorter delay of apn retry for certain reasons" into nyc-mr1-dev

parents 96e9002d d9ba2683
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ public class ApnContext {
     * @return The delay in milliseconds
     */
    public long getDelayForNextApn(boolean failFastEnabled) {
        return mRetryManager.getDelayForNextApn(failFastEnabled);
        return mRetryManager.getDelayForNextApn(failFastEnabled || isFastRetryReason());
    }

    /**
@@ -338,6 +338,15 @@ public class ApnContext {
                                || (mState == DctConstants.State.FAILED));
    }

    /**
     * Check if apn reason is fast retry reason which should apply shorter delay between apn re-try.
     * @return True if it is fast retry reason, otherwise false.
     */
    private boolean isFastRetryReason() {
        return mReason.equals(Phone.REASON_NW_TYPE_CHANGED) ||
                mReason.equals(Phone.REASON_APN_CHANGED);
    }

    /** Check if the data call is in connected or connecting state.
     * @return True if the data call is in connected or connecting state
     */
@@ -525,7 +534,7 @@ public class ApnContext {
    }

    public long getInterApnDelay(boolean failFastEnabled) {
        return mRetryManager.getInterApnDelay(failFastEnabled);
        return mRetryManager.getInterApnDelay(failFastEnabled || isFastRetryReason());
    }

    public static int apnIdForType(int networkType) {