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

Commit a6855ef9 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 876763e9: Make EnableFailFastRefCounter a singleton.

* commit '876763e9':
  Make EnableFailFastRefCounter a singleton.
parents af532402 876763e9
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ public abstract class DcTrackerBase extends Handler {
    // Controls when a simple recovery attempt it to be tried
    protected int mNoRecvPollCount = 0;
    // Refrence counter for enabling fail fast
    protected int mEnableFailFastRefCounter = 0;
    protected static int sEnableFailFastRefCounter = 0;
    // True if data stall detection is enabled
    protected volatile boolean mDataStallDetectionEnabled = true;

@@ -757,24 +757,24 @@ public abstract class DcTrackerBase extends Handler {
                break;
            }
            case DctConstants.CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA: {
                mEnableFailFastRefCounter += (msg.arg1 == DctConstants.ENABLED) ? 1 : -1;
                sEnableFailFastRefCounter += (msg.arg1 == DctConstants.ENABLED) ? 1 : -1;
                if (DBG) {
                    log("CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA: "
                            + " mEnableFailFastRefCounter=" + mEnableFailFastRefCounter);
                            + " sEnableFailFastRefCounter=" + sEnableFailFastRefCounter);
                }
                if (mEnableFailFastRefCounter < 0) {
                if (sEnableFailFastRefCounter < 0) {
                    final String s = "CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA: "
                            + "mEnableFailFastRefCounter < 0";
                            + "sEnableFailFastRefCounter:" + sEnableFailFastRefCounter + " < 0";
                    loge(s);
                    sEnableFailFastRefCounter = 0;
                    if (Build.IS_DEBUGGABLE) {
                        throw new RuntimeException(s);
                    }
                    loge(s);
                    mEnableFailFastRefCounter = 0;
                }
                final boolean enabled = mEnableFailFastRefCounter > 0;
                final boolean enabled = sEnableFailFastRefCounter > 0;
                if (DBG) {
                    log("CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA: enabled=" + enabled
                            + " mEnableFailFastRefCounter=" + mEnableFailFastRefCounter);
                            + " sEnableFailFastRefCounter=" + sEnableFailFastRefCounter);
                }
                if (mFailFast != enabled) {
                    mFailFast = enabled;