Loading core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1911,7 +1911,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @Nullable ImeTracker.Token statsToken) { // TODO(b/166736352): We should only skip the animation of specific types, not all types. boolean skipsAnim = false; if ((types & ime()) != 0) { if (!Flags.unifySkipAnimationOnceWithInitiallyVisible() && (types & ime()) != 0) { final InsetsSourceControl imeControl = mImeSourceConsumer.getControl(); // Skip showing animation once that made by system for some reason. // (e.g. starting window with hasImeSurface) Loading core/java/android/view/inputmethod/flags.aconfig +6 −0 Original line number Diff line number Diff line Loading @@ -221,3 +221,9 @@ flag { } } flag { name: "unify_skip_animation_once_with_initially_visible" namespace: "input_method" description: "Deprecating skipAnimationOnce and using initiallyVisible instead." bug: "440511879" } services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +41 −1 Original line number Diff line number Diff line Loading @@ -211,12 +211,52 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { return isSurfaceVisible; } @Override protected boolean isInitiallyVisible(@NonNull InsetsControlTarget target) { boolean initiallyVisible = super.isInitiallyVisible(target); // parent initiallyVisible is true, if it is client visible. if (initiallyVisible && mServerVisible) { WindowContainer<?> imeParentWindow = mDisplayContent.getImeParentWindow(); // If the IME is attached to an app window, only consider it initially visible // if the parent is visible and wasn't part of a transition. initiallyVisible = imeParentWindow != null && !imeParentWindow.inTransition() && imeParentWindow.isVisible() && imeParentWindow.isVisibleRequested(); } else { initiallyVisible = false; } if (android.view.inputmethod.Flags.unifySkipAnimationOnceWithInitiallyVisible() && !initiallyVisible && target.getWindow() != null) { final var targetWin = target.getWindow(); final Task task = targetWin.getTask(); // If the control target has a starting window, and its snapshot was captured while // the IME was visible, skip the next IME show animation on the IME source control, // to gracefully restore the IME visibility. StartingData startingData = null; if (task != null) { startingData = targetWin.mActivityRecord.mStartingData; if (startingData == null) { final WindowState startingWin = task.topStartingWindow(); if (startingWin != null) { startingData = startingWin.mStartingData; } } initiallyVisible = startingData != null && startingData.hasImeSurface(); ProtoLog.d(WM_DEBUG_IME, "Overwriting initiallyVisible %s for %s", initiallyVisible, targetWin); } } return initiallyVisible; } @Nullable @Override InsetsSourceControl getControl(@NonNull InsetsControlTarget target) { final InsetsSourceControl control = super.getControl(target); final WindowState targetWin = target.getWindow(); if (control != null && targetWin != null) { if (!android.view.inputmethod.Flags.unifySkipAnimationOnceWithInitiallyVisible() && control != null && targetWin != null) { final Task task = targetWin.getTask(); // If the control target has a starting window, and its snapshot was captured while // the IME was visible, skip the next IME show animation on the IME source control, Loading services/core/java/com/android/server/wm/InsetsSourceProvider.java +9 −12 Original line number Diff line number Diff line Loading @@ -195,6 +195,14 @@ class InsetsSourceProvider { return mWin != null && mWin.wouldBeVisibleIfPolicyIgnored() && mWin.isVisibleByPolicy(); } /** * @param target the current control target. * @return whether the {@link InsetsSourceControl} should be initially visible. */ protected boolean isInitiallyVisible(@NonNull InsetsControlTarget target) { return mClientVisible; } /** * Updates the window that currently backs this source. * Loading Loading @@ -504,22 +512,11 @@ class InsetsSourceProvider { // will be changed earlier than expected, which can cause flicker. return; } boolean initiallyVisible = mClientVisible; final Point surfacePosition = getWindowFrameSurfacePosition(mWin); mPosition.set(surfacePosition); mAdapter = new ControlAdapter(surfacePosition); final boolean initiallyVisible = isInitiallyVisible(target); if (mSource.getType() == WindowInsets.Type.ime()) { if (mClientVisible && mServerVisible) { WindowContainer imeParentWindow = mDisplayContent.getImeParentWindow(); // If the IME is attached to an app window, only consider it initially visible // if the parent is visible and wasn't part of a transition. initiallyVisible = imeParentWindow != null && !imeParentWindow.inTransition() && imeParentWindow.isVisible() && imeParentWindow.isVisibleRequested(); } else { initiallyVisible = false; } setClientVisible(target.isRequestedVisible(WindowInsets.Type.ime())); } final Transaction t = mWin.getSyncTransaction(); Loading Loading
core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1911,7 +1911,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @Nullable ImeTracker.Token statsToken) { // TODO(b/166736352): We should only skip the animation of specific types, not all types. boolean skipsAnim = false; if ((types & ime()) != 0) { if (!Flags.unifySkipAnimationOnceWithInitiallyVisible() && (types & ime()) != 0) { final InsetsSourceControl imeControl = mImeSourceConsumer.getControl(); // Skip showing animation once that made by system for some reason. // (e.g. starting window with hasImeSurface) Loading
core/java/android/view/inputmethod/flags.aconfig +6 −0 Original line number Diff line number Diff line Loading @@ -221,3 +221,9 @@ flag { } } flag { name: "unify_skip_animation_once_with_initially_visible" namespace: "input_method" description: "Deprecating skipAnimationOnce and using initiallyVisible instead." bug: "440511879" }
services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +41 −1 Original line number Diff line number Diff line Loading @@ -211,12 +211,52 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { return isSurfaceVisible; } @Override protected boolean isInitiallyVisible(@NonNull InsetsControlTarget target) { boolean initiallyVisible = super.isInitiallyVisible(target); // parent initiallyVisible is true, if it is client visible. if (initiallyVisible && mServerVisible) { WindowContainer<?> imeParentWindow = mDisplayContent.getImeParentWindow(); // If the IME is attached to an app window, only consider it initially visible // if the parent is visible and wasn't part of a transition. initiallyVisible = imeParentWindow != null && !imeParentWindow.inTransition() && imeParentWindow.isVisible() && imeParentWindow.isVisibleRequested(); } else { initiallyVisible = false; } if (android.view.inputmethod.Flags.unifySkipAnimationOnceWithInitiallyVisible() && !initiallyVisible && target.getWindow() != null) { final var targetWin = target.getWindow(); final Task task = targetWin.getTask(); // If the control target has a starting window, and its snapshot was captured while // the IME was visible, skip the next IME show animation on the IME source control, // to gracefully restore the IME visibility. StartingData startingData = null; if (task != null) { startingData = targetWin.mActivityRecord.mStartingData; if (startingData == null) { final WindowState startingWin = task.topStartingWindow(); if (startingWin != null) { startingData = startingWin.mStartingData; } } initiallyVisible = startingData != null && startingData.hasImeSurface(); ProtoLog.d(WM_DEBUG_IME, "Overwriting initiallyVisible %s for %s", initiallyVisible, targetWin); } } return initiallyVisible; } @Nullable @Override InsetsSourceControl getControl(@NonNull InsetsControlTarget target) { final InsetsSourceControl control = super.getControl(target); final WindowState targetWin = target.getWindow(); if (control != null && targetWin != null) { if (!android.view.inputmethod.Flags.unifySkipAnimationOnceWithInitiallyVisible() && control != null && targetWin != null) { final Task task = targetWin.getTask(); // If the control target has a starting window, and its snapshot was captured while // the IME was visible, skip the next IME show animation on the IME source control, Loading
services/core/java/com/android/server/wm/InsetsSourceProvider.java +9 −12 Original line number Diff line number Diff line Loading @@ -195,6 +195,14 @@ class InsetsSourceProvider { return mWin != null && mWin.wouldBeVisibleIfPolicyIgnored() && mWin.isVisibleByPolicy(); } /** * @param target the current control target. * @return whether the {@link InsetsSourceControl} should be initially visible. */ protected boolean isInitiallyVisible(@NonNull InsetsControlTarget target) { return mClientVisible; } /** * Updates the window that currently backs this source. * Loading Loading @@ -504,22 +512,11 @@ class InsetsSourceProvider { // will be changed earlier than expected, which can cause flicker. return; } boolean initiallyVisible = mClientVisible; final Point surfacePosition = getWindowFrameSurfacePosition(mWin); mPosition.set(surfacePosition); mAdapter = new ControlAdapter(surfacePosition); final boolean initiallyVisible = isInitiallyVisible(target); if (mSource.getType() == WindowInsets.Type.ime()) { if (mClientVisible && mServerVisible) { WindowContainer imeParentWindow = mDisplayContent.getImeParentWindow(); // If the IME is attached to an app window, only consider it initially visible // if the parent is visible and wasn't part of a transition. initiallyVisible = imeParentWindow != null && !imeParentWindow.inTransition() && imeParentWindow.isVisible() && imeParentWindow.isVisibleRequested(); } else { initiallyVisible = false; } setClientVisible(target.isRequestedVisible(WindowInsets.Type.ime())); } final Transaction t = mWin.getSyncTransaction(); Loading