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

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

Merge "Introduce IMMS#getUserData()" into main

parents afce9acb 076049a7
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -484,12 +484,19 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    @SharedByAllUsersField
    boolean mSystemReady;

    @GuardedBy("ImfLock.class")
    @NonNull
    UserDataRepository.UserData getUserData(@UserIdInt int userId) {
        return mUserDataRepository.getOrCreate(userId);
    }

    @GuardedBy("ImfLock.class")
    @NonNull
    InputMethodBindingController getInputMethodBindingController(@UserIdInt int userId) {
        return mUserDataRepository.getOrCreate(userId).mBindingController;
        return getUserData(userId).mBindingController;
    }


    /**
     * Id obtained with {@link InputMethodInfo#getId()} for the currently selected input method.
     * This is to be synchronized with the secure settings keyed with
@@ -1168,7 +1175,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            final int userId = user.getUserIdentifier();
            SecureSettingsWrapper.onUserStarting(userId);
            synchronized (ImfLock.class) {
                mService.mUserDataRepository.getOrCreate(userId);
                mService.getUserData(userId);
                if (mService.mExperimentalConcurrentMultiUserModeEnabled) {
                    if (mService.mCurrentUserId != userId && mService.mSystemReady) {
                        mService.experimentalInitializeVisibleBackgroundUserLocked(userId);
@@ -1290,7 +1297,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    bindingControllerForTesting != null ? bindingControllerForTesting
                            : bindingControllerFactory);
            for (int id : mUserManagerInternal.getUserIds()) {
                mUserDataRepository.getOrCreate(id);
                getUserData(id);
            }

            final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
@@ -2489,8 +2496,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

    @GuardedBy("ImfLock.class")
    void resetCurrentMethodAndClientLocked(@UnbindReason int unbindClientReason) {
        final var bindingController =
                mUserDataRepository.getOrCreate(mCurrentUserId).mBindingController;
        final var bindingController = getInputMethodBindingController(mCurrentUserId);
        bindingController.setSelectedMethodId(null);

        // Callback before clean-up binding states.