The nav bar isn't restored when swiping an app up to home in landscape

Previously we used FadeRotateAnimationController.isTargetToken() to
determine whether the FadeRotateAnimationController is controlling the
nav bar or not.
But this method is actually to check if the system can run the rotation
animation without waiting for the given window to be drawn.

Add a new method in FadeRotateAnimationController to check whether the
window is controlled by the FadeRotateAnimationController.

Bug: 188749233
Test: manual - swipe an app in landscape to home and observe the nav bar
Change-Id: I6e79bea7d9e7e651254efe9d02b416902372f2cd
This commit is contained in:
shawnlin
2021-05-20 15:48:25 +08:00
committed by Shawn Lin
parent b04a005c3f
commit 0341dfd40d
2 changed files with 7 additions and 2 deletions

View File

@@ -1782,7 +1782,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
return false;
}
final FadeRotationAnimationController controller = mFadeRotationAnimationController;
return controller == null || !controller.isTargetToken(w.mToken);
return controller == null || !controller.isHandledToken(w.mToken);
}
void notifyInsetsChanged(Consumer<WindowState> dispatchInsetsChanged) {

View File

@@ -123,8 +123,13 @@ public class FadeRotationAnimationController extends FadeAnimationController {
}
/** Returns {@code true} if the window is handled by this controller. */
boolean isHandledToken(WindowToken token) {
return token == mNavBarToken || isTargetToken(token);
}
/** Returns {@code true} if the controller will run fade animations on the window. */
boolean isTargetToken(WindowToken token) {
return token == mNavBarToken || mTargetWindowTokens.contains(token);
return mTargetWindowTokens.contains(token);
}
void setOnShowRunnable(Runnable onShowRunnable) {