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

Commit 85d3b0fa authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Add debug dataEnable." into lmp-mr1-dev

parents 1e1251cc a4f4d185
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -966,22 +966,29 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
    }

    /**
     * Local cache of value, used to work around delay when
     * {@link ConnectivityManager#setMobileDataEnabled(boolean)} is async.
     * Local cache of value, used to work around delays.
     */
    private Boolean mMobileDataEnabled;

    private boolean isMobileDataEnabled(int subId) {
        if (LOGD) Log.d(TAG, "isMobileDataEnabled:+ subId=" + subId);
        boolean isEnable = false;
        if (mMobileDataEnabled != null) {
            // TODO: deprecate and remove this once enabled flag is on policy
            // Multiple Subscriptions, the value need to be reseted
            isEnable = mMobileDataEnabled.booleanValue();
            if (LOGD) {
                Log.d(TAG, "isMobileDataEnabled: != null, subId=" + subId
                        + " isEnable=" + isEnable);
            }
            mMobileDataEnabled = null;
        } else {
            // SUB SELECT
            isEnable = mTelephonyManager.getDataEnabled()
                && (subId == mSubscriptionManager.getDefaultDataSubId());
            isEnable = mTelephonyManager.getDataEnabled(subId);
            if (LOGD) {
                Log.d(TAG, "isMobileDataEnabled: == null, subId=" + subId
                        + " isEnable=" + isEnable);
            }
        }
        return isEnable;
    }