Merge "Fix issue with leaked preserved surface" into pi-dev
This commit is contained in:
@@ -4106,11 +4106,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
mDestroying = true;
|
mDestroying = true;
|
||||||
|
|
||||||
final boolean hasSurface = mWinAnimator.hasSurface();
|
final boolean hasSurface = mWinAnimator.hasSurface();
|
||||||
if (hasSurface) {
|
|
||||||
// Use pendingTransaction here so hide is done the same transaction as the other
|
// Use pendingTransaction here so hide is done the same transaction as the other
|
||||||
// animations when exiting
|
// animations when exiting
|
||||||
mWinAnimator.hide(getPendingTransaction(), "onExitAnimationDone");
|
mWinAnimator.hide(getPendingTransaction(), "onExitAnimationDone");
|
||||||
}
|
|
||||||
|
|
||||||
// If we have an app token, we ask it to destroy the surface for us, so that it can take
|
// If we have an app token, we ask it to destroy the surface for us, so that it can take
|
||||||
// care to ensure the activity has actually stopped and the surface is not still in use.
|
// care to ensure the activity has actually stopped and the surface is not still in use.
|
||||||
|
|||||||
@@ -308,6 +308,12 @@ class WindowStateAnimator {
|
|||||||
if (!mLastHidden) {
|
if (!mLastHidden) {
|
||||||
//dump();
|
//dump();
|
||||||
mLastHidden = true;
|
mLastHidden = true;
|
||||||
|
|
||||||
|
// We may have a preserved surface which we no longer need. If there was a quick
|
||||||
|
// VISIBLE, GONE, VISIBLE, GONE sequence, the surface may never draw, so we don't mark
|
||||||
|
// it to be destroyed in prepareSurfaceLocked.
|
||||||
|
markPreservedSurfaceForDestroy();
|
||||||
|
|
||||||
if (mSurfaceController != null) {
|
if (mSurfaceController != null) {
|
||||||
mSurfaceController.hide(transaction, reason);
|
mSurfaceController.hide(transaction, reason);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user