Make EnableFailFastRefCounter a singleton.

Since there is only one DCT the mEnableFailFastRefCounter can be a
static/singleton and thus properly refcount the
CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA. There is still one problem
and that is if the PhoneApp crashes the singleton will be reinstantiated
and we'll have the same problem, but the frequency of this is small.
Also, the consequence of this is the DCT will be behaving "normally"
in that it will be attempting to do data-stall recovery although we
might like it not to it is the "normal" behavior.

Bug: 10304904
Change-Id: I4197c4236a402aa247f775e480e747620fd189bd
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
index 7c11eca..683a6ba 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
@@ -206,7 +206,7 @@
     // 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 @@
                 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;