Workaround for flicker between handoff from app to task view

- Defer finishing the recents animation for a couple frames until the
  frame has likely been pushed to sf and drawn, otherwise the reparenting
  of the app surface may happen before the task view is visible in
  Launcher.

Bug: 111299394
Test: Swipe up repeatedly from an app
Change-Id: I627dc085a5e376436b2b8eb5841c45fd36deff42
This commit is contained in:
Winson Chung
2018-07-11 10:56:48 -07:00
parent f912bd955f
commit 35a6848fa8

View File

@@ -882,8 +882,21 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
// new thumbnail
finishTransitionPosted = new WindowCallbacksCompat(taskView) {
// The number of frames to defer until we actually finish the animation
private int mDeferFrameCount = 2;
@Override
public void onPostDraw(Canvas canvas) {
if (mDeferFrameCount > 0) {
mDeferFrameCount--;
// Workaround, detach and reattach to invalidate the root node for
// another draw
detach();
attach();
taskView.invalidate();
return;
}
setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
detach();
}