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

Commit e51b3c93 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Merge "Flag cleanup: keyboard_layout_manager_multi_user_ime_setup" into main

parents 4c1626e1 737ae824
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -56,16 +56,6 @@ flag {
    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
    }
}

flag {
    name: "modifier_shortcut_dump"
    namespace: "input"
+4 −13
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ 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;
@@ -68,7 +66,6 @@ import android.util.SparseArray;
import android.view.InputDevice;
import android.view.KeyCharacterMap;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;

import com.android.internal.R;
@@ -1081,8 +1078,6 @@ class KeyboardLayoutManager implements InputManager.InputDeviceListener {
        List<ImeInfo> imeInfoList = new ArrayList<>();
        UserManager userManager = Objects.requireNonNull(
                mContext.getSystemService(UserManager.class));
        InputMethodManager inputMethodManager = Objects.requireNonNull(
                mContext.getSystemService(InputMethodManager.class));
        // Need to use InputMethodManagerInternal to call getEnabledInputMethodListAsUser()
        // instead of using InputMethodManager which uses enforceCallingPermissions() that
        // breaks when we are calling the method for work profile user ID since it doesn't check
@@ -1093,14 +1088,10 @@ class KeyboardLayoutManager implements InputManager.InputDeviceListener {
            for (InputMethodInfo imeInfo :
                    inputMethodManagerInternal.getEnabledInputMethodListAsUser(
                            userId)) {
                final List<InputMethodSubtype> imeSubtypes;
                if (keyboardLayoutManagerMultiUserImeSetup()) {
                    imeSubtypes = inputMethodManagerInternal.getEnabledInputMethodSubtypeListAsUser(
                            imeInfo.getId(), true /* allowsImplicitlyEnabledSubtypes */, userId);
                } else {
                    imeSubtypes = inputMethodManager.getEnabledInputMethodSubtypeList(imeInfo,
                            true /* allowsImplicitlyEnabledSubtypes */);
                }
                final List<InputMethodSubtype> imeSubtypes =
                        inputMethodManagerInternal.getEnabledInputMethodSubtypeListAsUser(
                                imeInfo.getId(), true /* allowsImplicitlyEnabledSubtypes */,
                                userId);
                for (InputMethodSubtype imeSubtype : imeSubtypes) {
                    if (!imeSubtype.isSuitableForPhysicalKeyboardLayoutMapping()) {
                        continue;