Merge "Apply transaction before calling onFinish" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
766485bece
@@ -51,6 +51,8 @@ import com.android.wm.shell.R;
|
|||||||
import com.android.wm.shell.common.ScreenshotUtils;
|
import com.android.wm.shell.common.ScreenshotUtils;
|
||||||
import com.android.wm.shell.common.SurfaceUtils;
|
import com.android.wm.shell.common.SurfaceUtils;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles split decor like showing resizing hint for a specific split.
|
* Handles split decor like showing resizing hint for a specific split.
|
||||||
*/
|
*/
|
||||||
@@ -251,7 +253,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Stops showing resizing hint. */
|
/** Stops showing resizing hint. */
|
||||||
public void onResized(SurfaceControl.Transaction t, Runnable animFinishedCallback) {
|
public void onResized(SurfaceControl.Transaction t, Consumer<Boolean> animFinishedCallback) {
|
||||||
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
|
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
|
||||||
mScreenshotAnimator.cancel();
|
mScreenshotAnimator.cancel();
|
||||||
}
|
}
|
||||||
@@ -281,7 +283,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
|
|||||||
mScreenshot = null;
|
mScreenshot = null;
|
||||||
|
|
||||||
if (mRunningAnimationCount == 0 && animFinishedCallback != null) {
|
if (mRunningAnimationCount == 0 && animFinishedCallback != null) {
|
||||||
animFinishedCallback.run();
|
animFinishedCallback.accept(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -313,12 +315,12 @@ public class SplitDecorManager extends WindowlessWindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mShown) {
|
if (mShown) {
|
||||||
fadeOutDecor(animFinishedCallback);
|
fadeOutDecor(()-> animFinishedCallback.accept(true));
|
||||||
} else {
|
} else {
|
||||||
// Decor surface is hidden so release it directly.
|
// Decor surface is hidden so release it directly.
|
||||||
releaseDecor(t);
|
releaseDecor(t);
|
||||||
if (mRunningAnimationCount == 0 && animFinishedCallback != null) {
|
if (mRunningAnimationCount == 0 && animFinishedCallback != null) {
|
||||||
animFinishedCallback.run();
|
animFinishedCallback.accept(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,11 +208,13 @@ class SplitScreenTransitions {
|
|||||||
mAnimations.add(va);
|
mAnimations.add(va);
|
||||||
|
|
||||||
decor.setScreenshotIfNeeded(change.getSnapshot(), startTransaction);
|
decor.setScreenshotIfNeeded(change.getSnapshot(), startTransaction);
|
||||||
decor.onResized(startTransaction, () -> {
|
decor.onResized(startTransaction, animated -> {
|
||||||
mTransitions.getMainExecutor().execute(() -> {
|
mAnimations.remove(va);
|
||||||
mAnimations.remove(va);
|
if (animated) {
|
||||||
onFinish(null /* wct */, null /* wctCB */);
|
mTransitions.getMainExecutor().execute(() -> {
|
||||||
});
|
onFinish(null /* wct */, null /* wctCB */);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user