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

Commit 574887ce authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Add debug log for empty IME list in switcher menu" into main

parents 2c5e3216 8bf31dca
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -900,6 +900,8 @@ public final class InputMethodInfo implements Parcelable {
                + Integer.toHexString(mIsDefaultResId));
        pw.println(prefix + "Service:");
        mService.dump(pw, prefix + "  ");
        pw.println(prefix + "InputMethodSubtype array: count=" + mSubtypes.getCount());
        mSubtypes.dump(pw, prefix + "  ");
    }

    @Override
+15 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.icu.util.ULocale;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Printer;
import android.util.Slog;

import com.android.internal.inputmethod.SubtypeLocaleUtils;
@@ -791,6 +792,20 @@ public final class InputMethodSubtype implements Parcelable {
        dest.writeInt(mIsAsciiCapable ? 1 : 0);
    }

    void dump(@NonNull Printer pw, @NonNull String prefix) {
        pw.println(prefix + "mSubtypeNameOverride=" + mSubtypeNameOverride
                + " mPkLanguageTag=" + mPkLanguageTag
                + " mPkLayoutType=" + mPkLayoutType
                + " mSubtypeId=" + mSubtypeId
                + " mSubtypeLocale=" + mSubtypeLocale
                + " mSubtypeLanguageTag=" + mSubtypeLanguageTag
                + " mSubtypeMode=" + mSubtypeMode
                + " mIsAuxiliary=" + mIsAuxiliary
                + " mOverridesImplicitlyEnabledSubtype=" + mOverridesImplicitlyEnabledSubtype
                + " mIsAsciiCapable=" + mIsAsciiCapable
                + " mSubtypeHashCode=" + mSubtypeHashCode);
    }

    public static final @android.annotation.NonNull Parcelable.Creator<InputMethodSubtype> CREATOR
            = new Parcelable.Creator<InputMethodSubtype>() {
        @Override
+15 −0
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@

package android.view.inputmethod;

import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.BadParcelableException;
import android.os.Parcel;
import android.util.Printer;
import android.util.Slog;

import java.io.ByteArrayInputStream;
@@ -174,6 +176,19 @@ public class InputMethodSubtypeArray {
    private volatile byte[] mCompressedData;
    private volatile int mDecompressedSize;

    void dump(@NonNull Printer pw, @NonNull String prefix) {
        final var innerPrefix = prefix + "  ";
        for (int i = 0; i < mCount; i++) {
            pw.println(prefix + "InputMethodSubtype #" + i + ":");
            final var subtype = get(i);
            if (subtype != null) {
                subtype.dump(pw, innerPrefix);
            } else {
                pw.println(innerPrefix + "missing subtype");
            }
        }
    }

    private static byte[] marshall(final InputMethodSubtype[] array) {
        Parcel parcel = null;
        try {
+8 −0
Original line number Diff line number Diff line
@@ -5023,6 +5023,14 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                            .getSortedInputMethodAndSubtypeList(
                                    showAuxSubtypes, isScreenLocked, true /* forImeMenu */,
                                    mContext, mSettings.getMethodMap(), mSettings.getUserId());
                    if (imList.isEmpty()) {
                        Slog.w(TAG, "Show switching menu failed, imList is empty,"
                                + " showAuxSubtypes: " + showAuxSubtypes
                                + " isScreenLocked: " + isScreenLocked
                                + " userId: " + mSettings.getUserId());
                        return false;
                    }

                    mMenuController.showInputMethodMenuLocked(showAuxSubtypes, displayId,
                            lastInputMethodId, lastInputMethodSubtypeId, imList);
                }
+0 −4
Original line number Diff line number Diff line
@@ -80,10 +80,6 @@ final class InputMethodMenuController {

        final int userId = mService.getCurrentImeUserIdLocked();

        if (imList.isEmpty()) {
            return;
        }

        hideInputMethodMenuLocked();

        if (preferredInputMethodSubtypeId == NOT_A_SUBTYPE_ID) {
Loading