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

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

Merge "SystemUI: Fix quick setting data icon no change with airplane mode"

parents 7376e3b6 00877268
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -422,6 +422,10 @@ class ExtQuickSettingsModel extends QuickSettingsModel {
            mContext.getContentResolver().registerContentObserver(
                    Settings.Global.getUriFor(Settings.Global.MOBILE_DATA),
                    false, this, mUserTracker.getCurrentUserId());

            mContext.getContentResolver().registerContentObserver(
                    Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON),
                    false, this, mUserTracker.getCurrentUserId());
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ class QuickSettings {

                    if (mModel.dataSwitchEnabled()) {
                        Resources r = mContext.getResources();
                        rssiState.signalIconId = rssiState.enabled
                        rssiState.signalIconId = rssiState.enabled && !mModel.isAirplaneModeOn()
                                ? R.drawable.ic_qs_data_on
                                : R.drawable.ic_qs_data_off;
                        rssiState.label = rssiState.enabled
+7 −4
Original line number Diff line number Diff line
@@ -877,11 +877,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
    }

    public boolean isRadioProhibited() {
        boolean airModeOn = (android.provider.Settings.System.getInt(
                mContext.getContentResolver(),
                android.provider.Settings.System.AIRPLANE_MODE_ON, 0) != 0);
        boolean disable = mContext.getResources().getBoolean(R.bool.config_disableWifiAndBluetooth);
        return disable && airModeOn;
        return disable && isAirplaneModeOn();
    }

    public boolean dataSwitchEnabled() {
@@ -896,4 +893,10 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
            mRSSICallback.refreshView(mRSSITile, mRSSIState);
        }
    }

    public boolean isAirplaneModeOn() {
        return (android.provider.Settings.System.getInt(
                mContext.getContentResolver(),
                android.provider.Settings.System.AIRPLANE_MODE_ON, 0) != 0);
    }
}