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

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

Merge "Make IMMS#onActionLocaleChanged() multi-user aware" into main

parents fc47eba9 686cb71d
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
     * Handles {@link Intent#ACTION_LOCALE_CHANGED}.
     *
     * <p>Note: For historical reasons, {@link Intent#ACTION_LOCALE_CHANGED} has been sent to all
     * the users. We should ignore this event if this is about any background user's locale.</p>
     * the users.</p>
     */
    void onActionLocaleChanged(@NonNull LocaleList prevLocales, @NonNull LocaleList newLocales) {
        if (DEBUG) {
@@ -665,15 +665,16 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        AdditionalSubtypeMapRepository.get(userId),
                        DirectBootAwareness.AUTO);
                InputMethodSettingsRepository.put(userId, settings);
            }
            // TODO(b/305849394): Dispatch this to non-current users.
            final int userId = mCurrentUserId;

                if (mConcurrentMultiUserModeEnabled || userId == mCurrentUserId) {
                    postInputMethodSettingUpdatedLocked(true /* resetDefaultEnabledIme */, userId);
                    // If the locale is changed, needs to reset the default ime
                    resetDefaultImeLocked(mContext, userId);
                    updateFromSettingsLocked(true, userId);
                }
            }
        }
    }

    final class MyPackageMonitor extends PackageMonitor {
        /**