@@ -7959,7 +7959,7 @@ private void updateResizingWindows(final WindowState w) {
79597959 Slog .v (TAG , "Resize reasons: "
79607960 + " contentInsetsChanged=" + w .mContentInsetsChanged
79617961 + " visibleInsetsChanged=" + w .mVisibleInsetsChanged
7962- + " surfaceResized=" + w . mWinAnimator .mSurfaceResized
7962+ + " surfaceResized=" + winAnimator .mSurfaceResized
79637963 + " configChanged=" + configChanged );
79647964 }
79657965
@@ -7974,23 +7974,23 @@ private void updateResizingWindows(final WindowState w) {
79747974 if (w .mOrientationChanging ) {
79757975 if (DEBUG_ORIENTATION ) Slog .v (TAG ,
79767976 "Orientation start waiting for draw in "
7977- + w + ", surface " + w . mWinAnimator .mSurface );
7977+ + w + ", surface " + winAnimator .mSurface );
79787978 winAnimator .mDrawState = WindowStateAnimator .DRAW_PENDING ;
79797979 if (w .mAppToken != null ) {
79807980 w .mAppToken .allDrawn = false ;
79817981 }
79827982 }
79837983 if (!mResizingWindows .contains (w )) {
79847984 if (DEBUG_RESIZE || DEBUG_ORIENTATION ) Slog .v (TAG ,
7985- "Resizing window " + w + " to " + w . mWinAnimator .mSurfaceW
7986- + "x" + w . mWinAnimator .mSurfaceH );
7985+ "Resizing window " + w + " to " + winAnimator .mSurfaceW
7986+ + "x" + winAnimator .mSurfaceH );
79877987 mResizingWindows .add (w );
79887988 }
79897989 } else if (w .mOrientationChanging ) {
79907990 if (w .isDrawnLw ()) {
79917991 if (DEBUG_ORIENTATION ) Slog .v (TAG ,
79927992 "Orientation not waiting for draw in "
7993- + w + ", surface " + w . mWinAnimator .mSurface );
7993+ + w + ", surface " + winAnimator .mSurface );
79947994 w .mOrientationChanging = false ;
79957995 }
79967996 }
@@ -8083,7 +8083,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
80838083 updateFocusedWindowLocked (UPDATE_FOCUS_WILL_PLACE_SURFACES ,
80848084 false /*updateInputWindows*/ );
80858085 }
8086-
8086+
80878087 // Initialize state of exiting tokens.
80888088 for (i =mExitingTokens .size ()-1 ; i >=0 ; i --) {
80898089 mExitingTokens .get (i ).hasVisible = false ;
@@ -8112,7 +8112,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
81128112
81138113 try {
81148114 int repeats = 0 ;
8115-
8115+
81168116 do {
81178117 repeats ++;
81188118 if (repeats > 6 ) {
@@ -8172,7 +8172,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
81728172 mInnerFields .mObscured = false ;
81738173 mInnerFields .mDimming = false ;
81748174 mInnerFields .mSyswin = false ;
8175-
8175+
81768176 boolean focusDisplayed = false ;
81778177 final int N = mWindows .size ();
81788178 for (i =N -1 ; i >=0 ; i --) {
@@ -8196,7 +8196,52 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
81968196 // has been updated accordingly.
81978197 updateWallpaperVisibilityLocked ();
81988198 }
8199+
8200+ final WindowStateAnimator winAnimator = w .mWinAnimator ;
8201+
8202+ // If the window has moved due to its containing
8203+ // content frame changing, then we'd like to animate
8204+ // it.
8205+ if (w .mHasSurface && w .shouldAnimateMove ()) {
8206+ // Frame has moved, containing content frame
8207+ // has also moved, and we're not currently animating...
8208+ // let's do something.
8209+ Animation a = AnimationUtils .loadAnimation (mContext ,
8210+ com .android .internal .R .anim .window_move_from_decor );
8211+ winAnimator .setAnimation (a );
8212+ winAnimator .mAnimDw = w .mLastFrame .left - w .mFrame .left ;
8213+ winAnimator .mAnimDh = w .mLastFrame .top - w .mFrame .top ;
8214+ } else {
8215+ winAnimator .mAnimDw = innerDw ;
8216+ winAnimator .mAnimDh = innerDh ;
8217+ }
8218+
8219+ //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing");
8220+ w .mContentChanged = false ;
8221+
8222+ // Moved from updateWindowsAndWallpaperLocked().
8223+ if (w .mHasSurface ) {
8224+ // Take care of the window being ready to display.
8225+ if (winAnimator .commitFinishDrawingLocked (currentTime )) {
8226+ if ((w .mAttrs .flags
8227+ & WindowManager .LayoutParams .FLAG_SHOW_WALLPAPER ) != 0 ) {
8228+ if (WindowManagerService .DEBUG_WALLPAPER ) Slog .v (TAG ,
8229+ "First draw done in potential wallpaper target " + w );
8230+ mInnerFields .mWallpaperMayChange = true ;
8231+ mPendingLayoutChanges |= WindowManagerPolicy .FINISH_LAYOUT_REDO_WALLPAPER ;
8232+ if (WindowManagerService .DEBUG_LAYOUT_REPEATS ) {
8233+ debugLayoutRepeats ("updateWindowsAndWallpaperLocked 1" ,
8234+ mPendingLayoutChanges );
8235+ }
8236+ }
8237+ }
8238+
8239+ winAnimator .setSurfaceBoundaries (recoveringMemory );
8240+ }
8241+
8242+ updateResizingWindows (w );
81998243 }
8244+
82008245 if (focusDisplayed ) {
82018246 mH .sendEmptyMessage (H .REPORT_LOSING_FOCUS );
82028247 }
@@ -8278,68 +8323,10 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
82788323 if (DEBUG_LAYOUT_REPEATS ) debugLayoutRepeats ("mLayoutNeeded" , mPendingLayoutChanges );
82798324 }
82808325
8281- final int N = mWindows .size ();
8282- for (i =N -1 ; i >=0 ; i --) {
8283- final WindowState w = mWindows .get (i );
8284- final WindowStateAnimator winAnimator = w .mWinAnimator ;
8285-
8286- // If the window has moved due to its containing
8287- // content frame changing, then we'd like to animate
8288- // it.
8289- if (w .mHasSurface && w .shouldAnimateMove ()) {
8290- // Frame has moved, containing content frame
8291- // has also moved, and we're not currently animating...
8292- // let's do something.
8293- Animation a = AnimationUtils .loadAnimation (mContext ,
8294- com .android .internal .R .anim .window_move_from_decor );
8295- winAnimator .setAnimation (a );
8296- winAnimator .mAnimDw = w .mLastFrame .left - w .mFrame .left ;
8297- winAnimator .mAnimDh = w .mLastFrame .top - w .mFrame .top ;
8298- } else {
8299- winAnimator .mAnimDw = innerDw ;
8300- winAnimator .mAnimDh = innerDh ;
8301- }
8302-
8303- //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing");
8304- w .mContentChanged = false ;
8305-
8306- // TODO(cmautner): Can this move up to the loop at the end of try/catch above?
8307- updateResizingWindows (w );
8308-
8309- // Moved from updateWindowsAndWallpaperLocked().
8310- if (w .mHasSurface ) {
8311- // Take care of the window being ready to display.
8312- if (winAnimator .commitFinishDrawingLocked (currentTime )) {
8313- if ((w .mAttrs .flags
8314- & WindowManager .LayoutParams .FLAG_SHOW_WALLPAPER ) != 0 ) {
8315- if (WindowManagerService .DEBUG_WALLPAPER ) Slog .v (TAG ,
8316- "First draw done in potential wallpaper target " + w );
8317- mInnerFields .mWallpaperMayChange = true ;
8318- mPendingLayoutChanges |= WindowManagerPolicy .FINISH_LAYOUT_REDO_WALLPAPER ;
8319- if (WindowManagerService .DEBUG_LAYOUT_REPEATS ) {
8320- debugLayoutRepeats ("updateWindowsAndWallpaperLocked 1" ,
8321- mPendingLayoutChanges );
8322- }
8323- }
8324- }
8325- }
8326- }
8327-
8328- if (DEBUG_ORIENTATION && mDisplayFrozen ) Slog .v (TAG ,
8329- "With display frozen, orientationChangeComplete="
8330- + mInnerFields .mOrientationChangeComplete );
8331- if (mInnerFields .mOrientationChangeComplete ) {
8332- if (mWindowsFreezingScreen ) {
8333- mWindowsFreezingScreen = false ;
8334- mH .removeMessages (H .WINDOW_FREEZE_TIMEOUT );
8335- }
8336- stopFreezingDisplayLocked ();
8337- }
8338-
83398326 if (!mResizingWindows .isEmpty ()) {
83408327 for (i = mResizingWindows .size () - 1 ; i >= 0 ; i --) {
83418328 WindowState win = mResizingWindows .get (i );
8342- final WindowStateAnimator winAnimator = win .mWinAnimator ;
8329+ final WindowStateAnimator winAnimator = win .mWinAnimator ;
83438330 try {
83448331 if (DEBUG_RESIZE || DEBUG_ORIENTATION ) Slog .v (TAG ,
83458332 "Reporting new frame to " + win + ": " + win .mCompatFrame );
@@ -8358,7 +8345,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
83588345 win .mConfiguration = mCurConfiguration ;
83598346 if (DEBUG_ORIENTATION &&
83608347 winAnimator .mDrawState == WindowStateAnimator .DRAW_PENDING ) Slog .i (
8361- TAG , "Resizing " + win + " WITH DRAW PENDING" );
8348+ TAG , "Resizing " + win + " WITH DRAW PENDING" );
83628349 win .mClient .resized ((int )winAnimator .mSurfaceW ,
83638350 (int )winAnimator .mSurfaceH ,
83648351 win .mLastContentInsets , win .mLastVisibleInsets ,
@@ -8374,6 +8361,17 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
83748361 mResizingWindows .clear ();
83758362 }
83768363
8364+ if (DEBUG_ORIENTATION && mDisplayFrozen ) Slog .v (TAG ,
8365+ "With display frozen, orientationChangeComplete="
8366+ + mInnerFields .mOrientationChangeComplete );
8367+ if (mInnerFields .mOrientationChangeComplete ) {
8368+ if (mWindowsFreezingScreen ) {
8369+ mWindowsFreezingScreen = false ;
8370+ mH .removeMessages (H .WINDOW_FREEZE_TIMEOUT );
8371+ }
8372+ stopFreezingDisplayLocked ();
8373+ }
8374+
83778375 // Destroy the surface of any windows that are no longer visible.
83788376 boolean wallpaperDestroyed = false ;
83798377 i = mDestroySurface .size ();
0 commit comments