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

Commit 123d9cf7 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

resolved conflicts for merge of 49853dc1 to master

Change-Id: I0d56965740d1273841e33cfc5db57b4df05915d1
parents 7e48e76c 49853dc1
Loading
Loading
Loading
Loading
+25 −10
Original line number Original line Diff line number Diff line
@@ -105,6 +105,8 @@ public class NetworkController extends BroadcastReceiver {
    private int mInetCondition = 0;
    private int mInetCondition = 0;
    private static final int INET_CONDITION_THRESHOLD = 50;
    private static final int INET_CONDITION_THRESHOLD = 50;


    private boolean mAirplaneMode = false;

    // our ui
    // our ui
    Context mContext;
    Context mContext;
    ArrayList<ImageView> mPhoneSignalIconViews = new ArrayList<ImageView>();
    ArrayList<ImageView> mPhoneSignalIconViews = new ArrayList<ImageView>();
@@ -170,8 +172,12 @@ public class NetworkController extends BroadcastReceiver {
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        filter.addAction(ConnectivityManager.INET_CONDITION_ACTION);
        filter.addAction(ConnectivityManager.INET_CONDITION_ACTION);
        filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
        filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
        filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
        context.registerReceiver(this, filter);
        context.registerReceiver(this, filter);


        // AIRPLANE_MODE_CHANGED is sent at boot; we've probably already missed it
        updateAirplaneMode();

        // yuck
        // yuck
        mBatteryStats = BatteryStatsService.getService();
        mBatteryStats = BatteryStatsService.getService();
    }
    }
@@ -228,6 +234,9 @@ public class NetworkController extends BroadcastReceiver {
            refreshViews();
            refreshViews();
        } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
        } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
            refreshViews();
            refreshViews();
        } else if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
            updateAirplaneMode();
            refreshViews();
        }
        }
    }
    }


@@ -343,18 +352,17 @@ public class NetworkController extends BroadcastReceiver {
        return (! "wifi-only".equals(SystemProperties.get("ro.carrier")));
        return (! "wifi-only".equals(SystemProperties.get("ro.carrier")));
    }
    }



    private void updateAirplaneMode() {
        mAirplaneMode = (Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.AIRPLANE_MODE_ON, 0) == 1);
    }

    private final void updateTelephonySignalStrength() {
    private final void updateTelephonySignalStrength() {
        // Display signal strength while in "emergency calls only" mode
        if (!hasService()) {
        if (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly())) {
            //Slog.d(TAG, "updateTelephonySignalStrength: no service");
            //Slog.d(TAG, "updateTelephonySignalStrength: no service");
            if (Settings.System.getInt(mContext.getContentResolver(),
                    Settings.System.AIRPLANE_MODE_ON, 0) == 1) {
                mPhoneSignalIconId = R.drawable.stat_sys_signal_flightmode;
                mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
            } else {
            mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
            mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
            mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
            mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
            }
        } else {
        } else {
            if (mSignalStrength == null) {
            if (mSignalStrength == null) {
                mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
                mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
@@ -719,6 +727,12 @@ public class NetworkController extends BroadcastReceiver {
            label = mContext.getString(R.string.bluetooth_tethered);
            label = mContext.getString(R.string.bluetooth_tethered);
            combinedSignalIconId = mBluetoothTetherIconId;
            combinedSignalIconId = mBluetoothTetherIconId;
            dataTypeIconId = 0;
            dataTypeIconId = 0;
        } else if (mAirplaneMode &&
                (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) {
            // Only display the flight-mode icon if not in "emergency calls only" mode.
            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
            combinedSignalIconId = R.drawable.stat_sys_signal_flightmode;
            dataTypeIconId = 0;
        } else {
        } else {
            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
            // On devices without mobile radios, we want to show the wifi icon
            // On devices without mobile radios, we want to show the wifi icon
@@ -732,6 +746,7 @@ public class NetworkController extends BroadcastReceiver {
                    + Integer.toHexString(combinedSignalIconId)
                    + Integer.toHexString(combinedSignalIconId)
                    + "/" + getResourceName(combinedSignalIconId)
                    + "/" + getResourceName(combinedSignalIconId)
                    + " dataDirectionOverlayIconId=0x" + Integer.toHexString(dataDirectionOverlayIconId)
                    + " dataDirectionOverlayIconId=0x" + Integer.toHexString(dataDirectionOverlayIconId)
                    + " mAirplaneMode=" + mAirplaneMode
                    + " mDataActivity=" + mDataActivity
                    + " mDataActivity=" + mDataActivity
                    + " mPhoneSignalIconId=0x" + Integer.toHexString(mPhoneSignalIconId)
                    + " mPhoneSignalIconId=0x" + Integer.toHexString(mPhoneSignalIconId)
                    + " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId)
                    + " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId)