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

Commit 0ea731f8 authored by xavihernandez's avatar xavihernandez
Browse files

SystemUI: allow update Mobile Network Type tile display

For the moment, this tile is only updated when clicking on it.
With these changes we have the same behavior as the other tiles:
if setting is changed in system settings, Mobile Network Type tile
display is updated.

    * Patch Set 1: Initial commit
    * Patch Set 2: Some corrections, commit message changed

Change-Id: I6cadadf4b9e3c9f478a4286e26d657da4f3ff015
parent 0c80e38c
Loading
Loading
Loading
Loading
+29 −1
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@ import com.android.internal.telephony.Phone;
import com.android.systemui.R;
import com.android.systemui.statusbar.phone.QuickSettingsContainerView;
import com.android.systemui.statusbar.phone.QuickSettingsController;
import com.android.systemui.statusbar.policy.NetworkController;
import com.android.systemui.statusbar.policy.NetworkController.NetworkSignalChangedCallback;

public class MobileNetworkTypeTile extends QuickSettingsTile {
public class MobileNetworkTypeTile extends QuickSettingsTile implements NetworkSignalChangedCallback {

    private static final String TAG = "NetworkModeQuickSettings";

@@ -195,4 +197,30 @@ public class MobileNetworkTypeTile extends QuickSettingsTile {
                Settings.System.EXPANDED_NETWORK_MODE,
                CM_MODE_3G2G);
    }

    @Override
    void onPostCreate() {
        NetworkController controller = new NetworkController(mContext);
        controller.addNetworkSignalChangedCallback(this);
        super.onPostCreate();
    }

    @Override
    public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
        String wifitSignalContentDescriptionId, String description) {
            // TODO Auto-generated method stub
    }

    @Override
    public void onMobileDataSignalChanged(boolean enabled,
        int mobileSignalIconId, String mobileSignalContentDescriptionId,
        int dataTypeIconId, String dataTypeContentDescriptionId,
        String description) {
            applyNetworkTypeChanges();
    }

    @Override
    public void onAirplaneModeChanged(boolean enabled) {
        // TODO Auto-generated method stub
    }
}