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

Commit a58cd270 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "SystemUI: Make DataUsageDetailView show the info for current DDS"

parents bd4004a7 279a9fe1
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import android.net.NetworkStatsHistory;
import android.net.NetworkTemplate;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.provider.Settings;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.format.DateUtils;
import android.text.format.Time;
@@ -189,7 +191,8 @@ public class MobileDataController {
    }

    public void setMobileDataEnabled(boolean enabled) {
        mTelephonyManager.setDataEnabled(enabled);
        mTelephonyManager.setDataEnabledUsingSubId(
                SubscriptionManager.getDefaultDataSubId(), enabled);
        if (mCallback != null) {
            mCallback.onMobileDataEnabled(enabled);
        }
@@ -198,16 +201,19 @@ public class MobileDataController {
    public boolean isMobileDataSupported() {
        // require both supported network and ready SIM
        return mConnectivityManager.isNetworkSupported(TYPE_MOBILE)
                && mTelephonyManager.getSimState() == SIM_STATE_READY;
                && mTelephonyManager.getSimState(
                        SubscriptionManager.getDefaultDataPhoneId()) == SIM_STATE_READY;
    }

    public boolean isMobileDataEnabled() {
        return mTelephonyManager.getDataEnabled();
        return Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.MOBILE_DATA + SubscriptionManager.getDefaultDataPhoneId(), 0) != 0;
    }

    private static String getActiveSubscriberId(Context context) {
        final TelephonyManager tele = TelephonyManager.from(context);
        final String actualSubscriberId = tele.getSubscriberId();
        final String actualSubscriberId =
                tele.getSubscriberId(SubscriptionManager.getDefaultDataSubId());
        return actualSubscriberId;
    }