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

Commit d76fc22f authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Ricardo Cerqueira
Browse files

SystemUI: Fix QuickSetting IME tile



The IME tile reference need to be saved to used at setImeWindowStatus method

Patchset 2: Reset IME tile prior to load tiles

Change-Id: I185c37ed91794af93bd6f750c1e0c039c15f6696
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent cb275b58
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class QuickSettingsController {
    private ContentObserver mObserver;
    public PhoneStatusBar mStatusBarService;

    private InputMethodTile IMETile;
    private InputMethodTile mIMETile;

    public QuickSettingsController(Context context, QuickSettingsContainerView container, PhoneStatusBar statusBarService) {
        mContext = context;
@@ -122,6 +122,8 @@ public class QuickSettingsController {
    }

    void loadTiles() {
        // Reset reference tiles
        mIMETile = null;

        // Filter items not compatible with device
        boolean bluetoothSupported = deviceSupportsBluetooth();
@@ -230,9 +232,9 @@ public class QuickSettingsController {
            mQuickSettingsTiles.add(qs);
        }
        if (Settings.System.getInt(resolver, Settings.System.QS_DYNAMIC_IME, 1) == 1) {
            QuickSettingsTile qs = new InputMethodTile(mContext, inflater, mContainerView, this);
            qs.setupQuickSettingsTile();
            mQuickSettingsTiles.add(qs);
            mIMETile = new InputMethodTile(mContext, inflater, mContainerView, this);
            mIMETile.setupQuickSettingsTile();
            mQuickSettingsTiles.add(mIMETile);
        }
        if (deviceSupportsUsbTether(mContext) && Settings.System.getInt(resolver, Settings.System.QS_DYNAMIC_USBTETHER, 1) == 1) {
            QuickSettingsTile qs = new UsbTetherTile(mContext, inflater, mContainerView, this);
@@ -333,8 +335,8 @@ public class QuickSettingsController {
    }

    public void setImeWindowStatus(boolean visible) {
        if (IMETile != null) {
            IMETile.toggleVisibility(visible);
        if (mIMETile != null) {
            mIMETile.toggleVisibility(visible);
        }
    }