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

Commit 21e20d2f authored by Stephen Bird's avatar Stephen Bird
Browse files

Revert "Data Toggle: Bring inline with mainline cyanogen settings"

This reverts commit faaee32d.

Change-Id: I0fdcba38140c2489bebbfb4d14e9f4e670ccc5a2
parent faaee32d
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -27,9 +27,6 @@ import android.nfc.NfcAdapter;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.Settings;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;

import com.android.internal.telephony.RILConstants;

import org.xmlpull.v1.XmlPullParser;
@@ -124,8 +121,7 @@ public final class ConnectionSettings implements Parcelable {
        BluetoothAdapter bta = BluetoothAdapter.getDefaultAdapter();
        LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        TelephonyManager tm = (TelephonyManager)
                context.getSystemService(Context.TELEPHONY_SERVICE);
        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NfcAdapter nfcAdapter = null;
        try {
            nfcAdapter = NfcAdapter.getNfcAdapter(context);
@@ -138,15 +134,9 @@ public final class ConnectionSettings implements Parcelable {

        switch (getConnectionId()) {
            case PROFILE_CONNECTION_MOBILEDATA:
                currentState = tm.getDataEnabled();
                currentState = cm.getMobileDataEnabled();
                if (forcedState != currentState) {
                    int phoneCount = tm.getPhoneCount();
                    for (int i = 0; i < phoneCount; i++) {
                        Settings.Global.putInt(context.getContentResolver(),
                                Settings.Global.MOBILE_DATA + i, (forcedState) ? 1 : 0);
                        int[] subId = SubscriptionManager.getSubId(i);
                        tm.setDataEnabled(subId[0], forcedState);
                    }
// hharte                    cm.setMobileDataEnabled(forcedState);
                }
                break;
            case PROFILE_CONNECTION_2G3G4G: