Add a debug command to poll IMMS.Lifecycle#onSwitchUser()
This is a quick workaround for a known limitation that adb shell am switch-user <user id> doesn't wait until com.android.server.SystemService#onSwitchUser() gets called. The problem is that UserController.switchUser() immediately returns soon after enqueuing a task to call back SystemService#onSwitchUser(). This means that on a slow device / environment, there is a chance that IMMS continues behaving as if a previous user was still interacting after switching a user. Ideally there should be a way to wait until all system servers finish handling SystemService#onSwitchUser() in am shell commands, but it may require non-trivial amount of changes in ActivityManagerShellCommand. In order to unblock on-going per-profile IME effort, this CL exposes an internal state of InputMethodManagerService (IMMS) so that CTS tests can wait until IMMS.Lifecycle#onSwitchUser() gets called with an expected user ID as a quick workaround. Bug: 120784635 Bug: 122469833 Test: adb shell cmd input_method get-last-switch-user-id Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases Change-Id: I07a0120d44bcb3e3d60d51c510e7e566ce424148
Loading
Please register or sign in to comment