Merge "Fix no AVD transfer to client when using setOnExitAnimationListener" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
17cea5da0f
@@ -4230,21 +4230,22 @@ public final class ActivityThread extends ClientTransactionHandler
|
|||||||
decorView.addView(view);
|
decorView.addView(view);
|
||||||
view.requestLayout();
|
view.requestLayout();
|
||||||
|
|
||||||
view.getViewTreeObserver().addOnDrawListener(new ViewTreeObserver.OnDrawListener() {
|
view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||||
private boolean mHandled = false;
|
private boolean mHandled = false;
|
||||||
@Override
|
@Override
|
||||||
public void onDraw() {
|
public boolean onPreDraw() {
|
||||||
if (mHandled) {
|
if (mHandled) {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
mHandled = true;
|
mHandled = true;
|
||||||
// Transfer the splash screen view from shell to client.
|
// Transfer the splash screen view from shell to client.
|
||||||
// Call syncTransferSplashscreenViewTransaction at the first onDraw so we can ensure
|
// Call syncTransferSplashscreenViewTransaction at the first onPreDraw, so we can
|
||||||
// the client view is ready to show and we can use applyTransactionOnDraw to make
|
// ensure the client view is ready to show, and can use applyTransactionOnDraw to
|
||||||
// all transitions happen at the same frame.
|
// make all transitions happen at the same frame.
|
||||||
syncTransferSplashscreenViewTransaction(
|
syncTransferSplashscreenViewTransaction(
|
||||||
view, r.token, decorView, startingWindowLeash);
|
view, r.token, decorView, startingWindowLeash);
|
||||||
view.post(() -> view.getViewTreeObserver().removeOnDrawListener(this));
|
view.post(() -> view.getViewTreeObserver().removeOnPreDrawListener(this));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user