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

Commit 08115125 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Revert "Show toast when subtype is rotated by Meta-Space."

This reverts commit ebda7d7a [1].

Reason for revert: to deprecate Meta-Space short cut.

 [1]: If3fe17adbffe4c1125783fc77fed3cfe78fc7933

Bug: 79150878
Test: manual
Change-Id: I33faa3c8c1cb8afbe43881ee79dfa9e7d788f67d
parent 136b6cec
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -152,7 +152,6 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RadioButton;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;

import com.android.server.wm.WindowManagerInternal;

@@ -608,7 +607,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    private AlertDialog mSwitchingDialog;
    private IBinder mSwitchingDialogToken = new Binder();
    private View mSwitchingDialogTitleView;
    private Toast mSubtypeSwitchedByShortCutToast;
    private InputMethodInfo[] mIms;
    private int[] mSubtypeIds;
    private LocaleList mLastSystemLocales;
@@ -3556,27 +3554,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                return;
            }
            setInputMethodLocked(nextSubtype.mImi.getId(), nextSubtype.mSubtypeId);
            if (mSubtypeSwitchedByShortCutToast != null) {
                mSubtypeSwitchedByShortCutToast.cancel();
                mSubtypeSwitchedByShortCutToast = null;
            }
            if ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0) {
                // IME window is shown.  The user should be able to visually understand that the
                // subtype is changed in most of cases.  To avoid UI overlap, we do not show a toast
                // in this case.
                return;
            }
            final InputMethodInfo newInputMethodInfo = mMethodMap.get(mCurMethodId);
            if (newInputMethodInfo == null) {
                return;
            }
            final CharSequence toastText = InputMethodUtils.getImeAndSubtypeDisplayName(mContext,
                    newInputMethodInfo, mCurrentSubtype);
            if (!TextUtils.isEmpty(toastText)) {
                mSubtypeSwitchedByShortCutToast = Toast.makeText(mContext, toastText.toString(),
                        Toast.LENGTH_SHORT);
                mSubtypeSwitchedByShortCutToast.show();
            }
        }
    }

@@ -4498,22 +4475,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    private static String imeWindowStatusToString(final int imeWindowVis) {
        final StringBuilder sb = new StringBuilder();
        boolean first = true;
        if ((imeWindowVis & InputMethodService.IME_ACTIVE) != 0) {
            sb.append("Active");
            first = false;
        }
        if ((imeWindowVis & InputMethodService.IME_VISIBLE) != 0) {
            if (!first) {
                sb.append("|");
            }
            sb.append("Visible");
        }
        return sb.toString();
    }

    @Override
    public IInputContentUriToken createInputContentUriToken(@Nullable IBinder token,
            @Nullable Uri contentUri, @Nullable String packageName) {
@@ -4631,7 +4592,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            method = mCurMethod;
            p.println("  mCurMethod=" + mCurMethod);
            p.println("  mEnabledSession=" + mEnabledSession);
            p.println("  mImeWindowVis=" + imeWindowStatusToString(mImeWindowVis));
            p.println("  mShowRequested=" + mShowRequested
                    + " mShowExplicitlyRequested=" + mShowExplicitlyRequested
                    + " mShowForced=" + mShowForced