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

Commit 06e0744e authored by satok's avatar satok
Browse files

Update the subtype icon properly.

Change-Id: Ib89959d1ea13f1e6f56e6280f90532e6695c4a00
parent a32edd4b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -16,10 +16,7 @@

package com.android.systemui.statusbar.tablet;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Handler;
@@ -36,13 +33,12 @@ import android.widget.ImageView;
import com.android.server.InputMethodManagerService;
import com.android.systemui.R;

import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;

public class InputMethodButton extends ImageView {

    private static final String  TAG = "StatusBar/InputMethodButton";
    private static final boolean DEBUG = false;

    private boolean mKeyboardShown;
    private ImageView mIcon;
@@ -94,6 +90,9 @@ public class InputMethodButton extends ImageView {
        InputMethodSubtype subtype = mImm.getCurrentInputMethodSubtype();
        Drawable icon = null;
        if (imi != null) {
            if (DEBUG) {
                Log.d(TAG, "--- Update icons of IME: " + imi.getPackageName() + "," + subtype);
            }
            if (subtype != null) {
                return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(),
                        imi.getServiceInfo().applicationInfo);
+7 −0
Original line number Diff line number Diff line
@@ -993,6 +993,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                        if (mCurMethod != null) {
                            try {
                                putSelectedInputMethodSubtype(info, subtypeId);
                                mCurrentSubtype = subtype;
                                if (mInputShown) {
                                    // If mInputShown is false, there is no IME button on the
                                    // system bar.
                                    // Thus there is no need to make it invisible explicitly.
                                    mStatusBar.setIMEButtonVisible(true);
                                }
                                mCurMethod.changeInputMethodSubtype(subtype);
                            } catch (RemoteException e) {
                                return;
+12 −11
Original line number Diff line number Diff line
@@ -263,7 +263,9 @@ public class StatusBarManagerService extends IStatusBarService.Stub
        if (SPEW) Slog.d(TAG, (visible?"showing":"hiding") + " IME Button");

        synchronized(mLock) {
            if (mIMEButtonVisible != visible) {
            // In case of IME change, we need to call up setIMEButtonVisible() regardless of
            // mIMEButtonVisible because mIMEButtonVisible may not have been set to false when the
            // previous IME was destroyed.
            mIMEButtonVisible = visible;
            mHandler.post(new Runnable() {
                public void run() {
@@ -277,7 +279,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
            });
        }
    }
    }

    /**
     * This is used for the automatic version of lights-out mode.  Only call this from