summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2023-10-12 23:04:47 +0000
committer Yohei Yukawa <yukawa@google.com> 2023-10-12 23:04:47 +0000
commit9c0d4785cc260d32edb2bc1d4ba2922b3c0aac8f (patch)
tree44645eb76b8e422110d9da3ec2100eddda2dfc1c
parentbb756a05d86802c25d2351ed0a316019109445e1 (diff)
Remove unnecessary workaround for IME switcher
This is a logical revert of an old workaround CL [1], which should no longer is necessary now. When the original CL [1] was written, Keyguard was always calling the following two APIs, which were always returning the current user's IME list at that time. * InputMethodManager#getEnabledInputMethodList() * InputMethodManager#getEnabledInputMethodSubtypeList() This is why a 500ms delay was needed in before Keyguard's calling these APIs at that time. Since then, during the work of per-profile IME project, we have already upgraded Keyguard to use * InputMethodManager#getEnabledInputMethodListAsUser() * InputMethodManager#getEnabledInputMethodSubtypeListAsUser() instead with an explicit user ID [2], which in theory can never have this kind of race condition. There must be no user observable behavior change. [1]: I93ea71d73540c31fbbe1cc4bd6747871f957dcc6 982a94c5e3cce47d6c7ae4cdf7a4dbcdcc75431f [2]: I6e7d7353c2b5b1da5d460ae005fb2585f85fb1c4 1fb13c59dea3c29aaed5d3e2155ce4acba7b7f7c Bug: 30640917 Test: atest SystemUiRoboTests Test: Manually verified that Bug 30640917 remains to be fixed. 1. Build aosp_bluejay-trunk_staging-userdebug and flash it 2. make -j SoftKeyboard 3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk 4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard 5. adb shell locksettings set-password aaaa 6. adb shell pm create-user test_user 7. adb shell am switch-user 10 8. adb shell am switch-user 0 9. Make sure that the IME switcher icon is shown Test: Manually verified that Bug 123904896 remains to be fixed. 1. Build aosp_bluejay-trunk_staging-userdebug and flash it 2. make -j SoftKeyboard 3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk 4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard 5. adb shell pm create-user test_user 6. adb shell am switch-user 10 7. adb shell locksettings set-password aaaa 8. adb shell wm dismiss-keyguard 9. Make sure that the IME switcher icon is not shown Change-Id: I37c8fe76e2a7daf322a86f5eb6c6986d988d4f93
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java8
1 files changed, 0 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
index 959cf6fb8565..01fc03516edc 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
@@ -51,7 +51,6 @@ import java.util.List;
public class KeyguardPasswordViewController
extends KeyguardAbsKeyInputViewController<KeyguardPasswordView> {
- private static final int DELAY_MILLIS_TO_REEVALUATE_IME_SWITCH_ICON = 500; // 500ms
private final KeyguardSecurityCallback mKeyguardSecurityCallback;
private final DevicePostureController mPostureController;
private final DevicePostureController.Callback mPostureCallback = posture ->
@@ -164,13 +163,6 @@ public class KeyguardPasswordViewController
// If there's more than one IME, enable the IME switcher button
updateSwitchImeButton();
-
- // When we the current user is switching, InputMethodManagerService sometimes has not
- // switched internal state yet here. As a quick workaround, we check the keyboard state
- // again.
- // TODO: Remove this workaround by ensuring such a race condition never happens.
- mMainExecutor.executeDelayed(
- this::updateSwitchImeButton, DELAY_MILLIS_TO_REEVALUATE_IME_SWITCH_ICON);
}
@Override