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

Commit 6355d098 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correctly setup IME subtypes in KeyboardLayoutManager in multi-user case" into main

parents c70fd81e da52c2c9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -75,3 +75,13 @@ flag {
    description: "Enables a developer overlay that displays raw touchpad input data and gesture recognition status in real-time."
    bug: "286551975"
}

flag {
    namespace: "input_native"
    name: "keyboard_layout_manager_multi_user_ime_setup"
    description: "Update KeyboardLayoutManager to work correctly with multi-user IME setup"
    bug: "354333072"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+11 −3
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import static android.hardware.input.KeyboardLayoutSelectionResult.LAYOUT_SELECT
import static android.hardware.input.KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD;
import static android.hardware.input.KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEFAULT;

import static com.android.hardware.input.Flags.keyboardLayoutManagerMultiUserImeSetup;

import android.annotation.AnyThread;
import android.annotation.MainThread;
import android.annotation.NonNull;
@@ -1066,9 +1068,15 @@ class KeyboardLayoutManager implements InputManager.InputDeviceListener {
            for (InputMethodInfo imeInfo :
                    inputMethodManagerInternal.getEnabledInputMethodListAsUser(
                            userId)) {
                for (InputMethodSubtype imeSubtype :
                        inputMethodManager.getEnabledInputMethodSubtypeList(
                                imeInfo, true /* allowsImplicitlyEnabledSubtypes */)) {
                final List<InputMethodSubtype> imeSubtypes;
                if (keyboardLayoutManagerMultiUserImeSetup()) {
                    imeSubtypes = inputMethodManagerInternal.getEnabledInputMethodSubtypeListAsUser(
                            imeInfo.getId(), true /* allowsImplicitlyEnabledSubtypes */, userId);
                } else {
                    imeSubtypes = inputMethodManager.getEnabledInputMethodSubtypeList(imeInfo,
                            true /* allowsImplicitlyEnabledSubtypes */);
                }
                for (InputMethodSubtype imeSubtype : imeSubtypes) {
                    if (!imeSubtype.isSuitableForPhysicalKeyboardLayoutMapping()) {
                        continue;
                    }