Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +0 −4 Original line number Diff line number Diff line Loading @@ -1017,7 +1017,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. final int userId = user.getUserIdentifier(); SecureSettingsWrapper.onUserStarting(userId); synchronized (ImfLock.class) { mService.getUserData(userId); if (mService.mConcurrentMultiUserModeEnabled) { if (mService.mCurrentUserId != userId && mService.mSystemReady) { mService.initializeVisibleBackgroundUserLocked(userId); Loading Loading @@ -1116,9 +1115,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mUserDataRepository = new UserDataRepository(mHandler, mUserManagerInternal, bindingControllerForTesting != null ? bindingControllerForTesting : bindingControllerFactory); for (int id : mUserManagerInternal.getUserIds()) { getUserData(id); } mMenuController = new InputMethodMenuController(this); mVisibilityStateComputer = new ImeVisibilityStateComputer(this); Loading services/core/java/com/android/server/inputmethod/UserDataRepository.java +0 −10 Original line number Diff line number Diff line Loading @@ -74,16 +74,6 @@ final class UserDataRepository { } }); } @Override public void onUserCreated(UserInfo user, Object unusedToken) { final int userId = user.id; handler.post(() -> { synchronized (ImfLock.class) { getOrCreate(userId); } }); } }); } Loading services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/UserDataRepositoryTest.java +9 −12 Original line number Diff line number Diff line Loading @@ -99,14 +99,8 @@ public final class UserDataRepositoryTest { listener.onUserCreated(userInfo, /* unused token */ new Object()); waitForIdle(); // Assert UserDataRepository contains the expected UserData final var allUserData = collectUserData(repository); assertThat(allUserData).hasSize(1); assertThat(allUserData.get(0).mUserId).isEqualTo(ANY_USER_ID); // Assert UserDataRepository called the InputMethodBindingController creator function. verify(bindingControllerFactorySpy).apply(ANY_USER_ID); assertThat(allUserData.get(0).mBindingController.getUserId()).isEqualTo(ANY_USER_ID); // Assert UserDataRepository remains to be empty. assertThat(collectUserData(repository)).isEmpty(); } @Test Loading @@ -121,12 +115,15 @@ public final class UserDataRepositoryTest { final var listener = captor.getValue(); // Add one UserData ... final var userInfo = new UserInfo(); userInfo.id = ANY_USER_ID; listener.onUserCreated(userInfo, /* unused token */ new Object()); waitForIdle(); synchronized (ImfLock.class) { final var userData = repository.getOrCreate(ANY_USER_ID); assertThat(userData.mUserId).isEqualTo(ANY_USER_ID); } // ... and then call onUserRemoved assertThat(collectUserData(repository)).hasSize(1); final var userInfo = new UserInfo(); userInfo.id = ANY_USER_ID; listener.onUserRemoved(userInfo); waitForIdle(); Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +0 −4 Original line number Diff line number Diff line Loading @@ -1017,7 +1017,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. final int userId = user.getUserIdentifier(); SecureSettingsWrapper.onUserStarting(userId); synchronized (ImfLock.class) { mService.getUserData(userId); if (mService.mConcurrentMultiUserModeEnabled) { if (mService.mCurrentUserId != userId && mService.mSystemReady) { mService.initializeVisibleBackgroundUserLocked(userId); Loading Loading @@ -1116,9 +1115,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mUserDataRepository = new UserDataRepository(mHandler, mUserManagerInternal, bindingControllerForTesting != null ? bindingControllerForTesting : bindingControllerFactory); for (int id : mUserManagerInternal.getUserIds()) { getUserData(id); } mMenuController = new InputMethodMenuController(this); mVisibilityStateComputer = new ImeVisibilityStateComputer(this); Loading
services/core/java/com/android/server/inputmethod/UserDataRepository.java +0 −10 Original line number Diff line number Diff line Loading @@ -74,16 +74,6 @@ final class UserDataRepository { } }); } @Override public void onUserCreated(UserInfo user, Object unusedToken) { final int userId = user.id; handler.post(() -> { synchronized (ImfLock.class) { getOrCreate(userId); } }); } }); } Loading
services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/UserDataRepositoryTest.java +9 −12 Original line number Diff line number Diff line Loading @@ -99,14 +99,8 @@ public final class UserDataRepositoryTest { listener.onUserCreated(userInfo, /* unused token */ new Object()); waitForIdle(); // Assert UserDataRepository contains the expected UserData final var allUserData = collectUserData(repository); assertThat(allUserData).hasSize(1); assertThat(allUserData.get(0).mUserId).isEqualTo(ANY_USER_ID); // Assert UserDataRepository called the InputMethodBindingController creator function. verify(bindingControllerFactorySpy).apply(ANY_USER_ID); assertThat(allUserData.get(0).mBindingController.getUserId()).isEqualTo(ANY_USER_ID); // Assert UserDataRepository remains to be empty. assertThat(collectUserData(repository)).isEmpty(); } @Test Loading @@ -121,12 +115,15 @@ public final class UserDataRepositoryTest { final var listener = captor.getValue(); // Add one UserData ... final var userInfo = new UserInfo(); userInfo.id = ANY_USER_ID; listener.onUserCreated(userInfo, /* unused token */ new Object()); waitForIdle(); synchronized (ImfLock.class) { final var userData = repository.getOrCreate(ANY_USER_ID); assertThat(userData.mUserId).isEqualTo(ANY_USER_ID); } // ... and then call onUserRemoved assertThat(collectUserData(repository)).hasSize(1); final var userInfo = new UserInfo(); userInfo.id = ANY_USER_ID; listener.onUserRemoved(userInfo); waitForIdle(); Loading