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

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

Merge "Fix the "ime set <imeId>" workaround" into main

parents c78fba16 eeaeee24
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -6588,6 +6588,28 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        out.print(imeId);
                        out.print(" selected for user #");
                        out.println(userId);

                        // Workaround for b/354782333.
                        final InputMethodSettings settings =
                                InputMethodSettingsRepository.get(userId);
                        final var bindingController = getInputMethodBindingController(userId);
                        final int deviceId = bindingController.getDeviceIdToShowIme();
                        final String settingsValue;
                        if (deviceId == DEVICE_ID_DEFAULT) {
                            settingsValue = settings.getSelectedInputMethod();
                        } else {
                            settingsValue = settings.getSelectedDefaultDeviceInputMethod();
                        }
                        if (!TextUtils.equals(settingsValue, imeId)) {
                            Slog.w(TAG, "DEFAULT_INPUT_METHOD=" + settingsValue
                                    + " is not updated. Fixing it up to " + imeId
                                    + " See b/354782333.");
                            if (deviceId == DEVICE_ID_DEFAULT) {
                                settings.putSelectedInputMethod(imeId);
                            } else {
                                settings.putSelectedDefaultDeviceInputMethod(imeId);
                            }
                        }
                    }
                    hasFailed |= failedToSelectUnknownIme;
                }