Make sure to clear outdated screenshot of splitting tasks

Make sure to clear the screenshot of splitting tasks if it's taking the
new one or being dismissed from split.

Bug: 272420717
Bug: 278134600
Test: pass existing tests
Change-Id: Ia159deccc8f0024143200e4dd44fadf67974a198
This commit is contained in:
Tony Huang
2023-04-14 08:52:46 +00:00
committed by Jerry Chang
parent 6eda179081
commit e4ec07516e

View File

@@ -164,6 +164,10 @@ public class SplitDecorManager extends WindowlessWindowManager {
t.remove(mGapBackgroundLeash);
mGapBackgroundLeash = null;
}
if (mScreenshot != null) {
t.remove(mScreenshot);
mScreenshot = null;
}
mHostLeash = null;
mIcon = null;
mResizingIconView = null;
@@ -323,6 +327,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
mScreenshotAnimator.cancel();
} else if (mScreenshot != null) {
t.remove(mScreenshot);
}
mTempRect.set(mOldBounds);
@@ -339,6 +345,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
mScreenshotAnimator.cancel();
} else if (mScreenshot != null) {
t.remove(mScreenshot);
}
mScreenshot = screenshot;