Merge "Fix a bug where surface crashes when the enter animation starts while the exit animation has not yet finished" into ics-mr1
This commit is contained in:
@@ -2578,11 +2578,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
(win.mAppToken == null || !win.mAppToken.clientHidden)) {
|
(win.mAppToken == null || !win.mAppToken.clientHidden)) {
|
||||||
displayed = !win.isVisibleLw();
|
displayed = !win.isVisibleLw();
|
||||||
if (win.mExiting) {
|
if (win.mExiting) {
|
||||||
win.mExiting = false;
|
win.cancelExitAnimationForNextAnimationLocked();
|
||||||
if (win.mAnimation != null) {
|
|
||||||
win.mAnimation.cancel();
|
|
||||||
win.mAnimation = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (win.mDestroying) {
|
if (win.mDestroying) {
|
||||||
win.mDestroying = false;
|
win.mDestroying = false;
|
||||||
|
|||||||
@@ -596,6 +596,18 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Fix and call finishExit() instead of cancelExitAnimationForNextAnimationLocked()
|
||||||
|
// for avoiding the code duplication.
|
||||||
|
void cancelExitAnimationForNextAnimationLocked() {
|
||||||
|
if (!mExiting) return;
|
||||||
|
if (mAnimation != null) {
|
||||||
|
mAnimation.cancel();
|
||||||
|
mAnimation = null;
|
||||||
|
destroySurfaceLocked();
|
||||||
|
}
|
||||||
|
mExiting = false;
|
||||||
|
}
|
||||||
|
|
||||||
Surface createSurfaceLocked() {
|
Surface createSurfaceLocked() {
|
||||||
if (mSurface == null) {
|
if (mSurface == null) {
|
||||||
mReportDestroySurface = false;
|
mReportDestroySurface = false;
|
||||||
@@ -1742,4 +1754,4 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
}
|
}
|
||||||
return mStringNameCache;
|
return mStringNameCache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user