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

Commit e1f73329 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Make sure to call SingleThreadedBackgroundWriter#onUserCreated() again

This is a follow up CL to my previous CL, which aimed to remove
UserLifecycleListener dependencies from random utility classes under

  com.android.server.inputmethod

package.

One thing I forgot to update was that

  AdditionalSubtypeMapRepository
      .SingleThreadedBackgroundWriter#onUserCreated()

stopped being called after that CL.

With this CL, we start calling it again as it used to be.

 [1]: I337fb084a9395eed7422d6889bf4f15d583c769c
      cf9acd88

Bug: 352354308
Test: presubmit
Test: atest FrameworksInputMethodSystemServerTests
Flag: EXEMPT refactor
Change-Id: I69786e5d22a4ef92ab52dd0b8304e40b87f1c9b5
parent e1a4e0e4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -219,6 +219,11 @@ final class AdditionalSubtypeMapRepository {
        sWriter.startThread();
    }

    @AnyThread
    static void onUserCreated(@UserIdInt int userId) {
        sWriter.onUserCreated(userId);
    }

    @AnyThread
    static void remove(@UserIdInt int userId, @NonNull Handler ioHandler) {
        sWriter.onUserRemoved(userId);
+3 −1
Original line number Diff line number Diff line
@@ -1013,7 +1013,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        @Override
        public void onUserCreated(UserInfo user, @Nullable Object token) {
            // Called directly from UserManagerService. Do not block the calling thread.
            initializeUsersAsync(new int[user.id]);
            final int userId = user.id;
            AdditionalSubtypeMapRepository.onUserCreated(userId);
            initializeUsersAsync(new int[userId]);
        }

        @Override