Skip to content

Commit ade0a9a

Browse files
author
Craig Mautner
committed
Save resized windows even if freezing.
During app freezes resized windows were being dropped if the freeze window timed out. This fix adds windows to the list of resized windows but does not notify the clients of the resize until freezing is completed. Bug: 7094175 fixed. Change-Id: Iee1f5f532a0e661fbf900e4540146ae4b645d68e
1 parent 1ad0fd9 commit ade0a9a

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8725,7 +8725,7 @@ private int animateAwayWallpaperLocked() {
87258725

87268726
private void updateResizingWindows(final WindowState w) {
87278727
final WindowStateAnimator winAnimator = w.mWinAnimator;
8728-
if (w.mHasSurface && !w.mAppFreezing && w.mLayoutSeq == mLayoutSeq) {
8728+
if (w.mHasSurface && w.mLayoutSeq == mLayoutSeq) {
87298729
w.mContentInsetsChanged |=
87308730
!w.mLastContentInsets.equals(w.mContentInsets);
87318731
w.mVisibleInsetsChanged |=
@@ -9260,39 +9260,41 @@ private final void performLayoutAndPlaceSurfacesLockedInner(boolean recoveringMe
92609260
defaultDisplay.pendingLayoutChanges);
92619261
}
92629262

9263-
if (!mResizingWindows.isEmpty()) {
9264-
for (i = mResizingWindows.size() - 1; i >= 0; i--) {
9265-
WindowState win = mResizingWindows.get(i);
9266-
final WindowStateAnimator winAnimator = win.mWinAnimator;
9267-
try {
9268-
if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
9269-
"Reporting new frame to " + win + ": " + win.mCompatFrame);
9270-
int diff = 0;
9271-
boolean configChanged = win.isConfigChanged();
9272-
if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION
9273-
// TODO: Remove once b/7094175 is fixed
9274-
|| ((String)win.mAttrs.getTitle()).contains("Keyguard"))
9275-
&& configChanged) {
9276-
Slog.i(TAG, "Sending new config to window " + win + ": "
9277-
+ winAnimator.mSurfaceW + "x" + winAnimator.mSurfaceH
9278-
+ " / " + mCurConfiguration + " / 0x"
9279-
+ Integer.toHexString(diff));
9280-
}
9281-
win.mConfiguration = mCurConfiguration;
9282-
if (DEBUG_ORIENTATION &&
9283-
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i(
9284-
TAG, "Resizing " + win + " WITH DRAW PENDING");
9285-
win.mClient.resized(win.mFrame, win.mLastContentInsets, win.mLastVisibleInsets,
9286-
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING,
9287-
configChanged ? win.mConfiguration : null);
9288-
win.mContentInsetsChanged = false;
9289-
win.mVisibleInsetsChanged = false;
9290-
winAnimator.mSurfaceResized = false;
9291-
} catch (RemoteException e) {
9292-
win.mOrientationChanging = false;
9293-
}
9263+
for (i = mResizingWindows.size() - 1; i >= 0; i--) {
9264+
WindowState win = mResizingWindows.get(i);
9265+
if (win.mAppFreezing) {
9266+
// Don't remove this window until rotation has completed.
9267+
continue;
9268+
}
9269+
final WindowStateAnimator winAnimator = win.mWinAnimator;
9270+
try {
9271+
if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
9272+
"Reporting new frame to " + win + ": " + win.mCompatFrame);
9273+
int diff = 0;
9274+
boolean configChanged = win.isConfigChanged();
9275+
if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION
9276+
// TODO: Remove once b/7094175 is fixed
9277+
|| ((String)win.mAttrs.getTitle()).contains("Keyguard"))
9278+
&& configChanged) {
9279+
Slog.i(TAG, "Sending new config to window " + win + ": "
9280+
+ winAnimator.mSurfaceW + "x" + winAnimator.mSurfaceH
9281+
+ " / " + mCurConfiguration + " / 0x"
9282+
+ Integer.toHexString(diff));
9283+
}
9284+
win.mConfiguration = mCurConfiguration;
9285+
if (DEBUG_ORIENTATION &&
9286+
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i(
9287+
TAG, "Resizing " + win + " WITH DRAW PENDING");
9288+
win.mClient.resized(win.mFrame, win.mLastContentInsets, win.mLastVisibleInsets,
9289+
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING,
9290+
configChanged ? win.mConfiguration : null);
9291+
win.mContentInsetsChanged = false;
9292+
win.mVisibleInsetsChanged = false;
9293+
winAnimator.mSurfaceResized = false;
9294+
} catch (RemoteException e) {
9295+
win.mOrientationChanging = false;
92949296
}
9295-
mResizingWindows.clear();
9297+
mResizingWindows.remove(i);
92969298
}
92979299

92989300
if (DEBUG_ORIENTATION && mDisplayFrozen) Slog.v(TAG,

0 commit comments

Comments
 (0)