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

Commit d9ba2683 authored by fionaxu's avatar fionaxu
Browse files

shorter delay of apn retry for certain reasons

this is based on external
CL:https://partner-android-review.googlesource.com/#/c/467885/1

Bug:26928735
Change-Id: Ie9dd07f13874d225b491d50f44d7daa3daaab34e
parent e274482c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ public class ApnContext {
     * @return The delay in milliseconds
     */
    public long getDelayForNextApn(boolean failFastEnabled) {
        return mRetryManager.getDelayForNextApn(failFastEnabled);
        return mRetryManager.getDelayForNextApn(failFastEnabled || isFastRetryReason());
    }

    /**
@@ -337,6 +337,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
     */
@@ -505,7 +514,7 @@ public class ApnContext {
    }

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

    public static int apnIdForType(int networkType) {