Add a WindowInsetsAnimationCallback to listen to IME changes.
This handles cases that were previously ignored, such as dismissing the IME with the back key/gesture. Removed extraneous manual state updates that were used for specific cases previously. The only remaining state updates are from our controlled IME animation in KeyboardInsetsHandler, as that correctly handles the case where you start closing the IME but end up keeping it open (or vice versa). Bug: 277738379 Fix: 320659754 Test: Manually go through various IME transitions on Launcher, open and close apps, lock/unlock, etc to verify keyboard state is correctly updated. And verify b/320659754 steps do not repro. Flag: NA Change-Id: I4787afbb37eed815b909a0215d8afeb3894ab985
This commit is contained in:
1 parent
b442235208
commit
a601341ff5
3 files changed
+25
-13
No files matched your search
@@ -19,7 +19,6 @@ import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR;
|
||||
|
||||
import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON;
|
||||
import static com.android.launcher3.Utilities.allowBGLaunch;
|
||||
import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_PENDING_INTENT;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
|
||||
@@ -280,12 +279,9 @@ public interface ActivityContext {
|
||||
if (wic != null) {
|
||||
// Only hide the keyboard if it is actually showing.
|
||||
if (isImeShown) {
|
||||
StatsLogManager slm = getStatsLogManager();
|
||||
slm.keyboardStateManager().setKeyboardState(HIDE);
|
||||
|
||||
// this method cannot be called cross threads
|
||||
wic.hide(WindowInsets.Type.ime());
|
||||
slm.logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
|
||||
getStatsLogManager().logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
|
||||
}
|
||||
|
||||
// If the WindowInsetsController is not null, we end here regardless of whether we
|
||||
|
||||
Reference in new issue
Block a user