1616import android .graphics .Rect ;
1717import android .graphics .Region ;
1818import android .os .Debug ;
19- import android .os .RemoteException ;
2019import android .util .Slog ;
2120import android .view .Surface ;
2221import android .view .SurfaceSession ;
@@ -379,10 +378,7 @@ void finishExit() {
379378 mService .mPendingRemove .add (mWin );
380379 mWin .mRemoveOnExit = false ;
381380 }
382- if (mService .mWallpaperTarget == mWin && mService .mLowerWallpaperTarget == null ) {
383- mAnimator .hideWallpapersLocked ();
384- mAnimator .mPendingLayoutChanges |= WindowManagerPolicy .FINISH_LAYOUT_REDO_WALLPAPER ;
385- }
381+ mAnimator .hideWallpapersLocked (mWin );
386382 }
387383
388384 void hide () {
@@ -738,6 +734,7 @@ void destroySurfaceLocked() {
738734 }
739735 mSurface .destroy ();
740736 }
737+ mAnimator .hideWallpapersLocked (mWin );
741738 } catch (RuntimeException e ) {
742739 Slog .w (TAG , "Exception thrown when destroying Window " + this
743740 + " surface " + mSurface + " session " + mSession
@@ -763,6 +760,7 @@ void destroyDeferredSurfaceLocked() {
763760 WindowManagerService .logSurface (mWin , "DESTROY PENDING" , e );
764761 }
765762 mPendingDestroySurface .destroy ();
763+ mAnimator .hideWallpapersLocked (mWin );
766764 }
767765 } catch (RuntimeException e ) {
768766 Slog .w (TAG , "Exception thrown when destroying Window "
@@ -1067,11 +1065,8 @@ public void prepareSurfaceLocked(final boolean recoveringMemory) {
10671065
10681066 if (w .mAttachedHidden || !w .isReadyForDisplay ()) {
10691067 hide ();
1070- // TODO: Consider moving the following into hide() and out of finishExit() as well.
1071- if (mService .mWallpaperTarget == mWin && mService .mLowerWallpaperTarget == null ) {
1072- mAnimator .hideWallpapersLocked ();
1073- mAnimator .mPendingLayoutChanges |= WindowManagerPolicy .FINISH_LAYOUT_REDO_WALLPAPER ;
1074- }
1068+ mAnimator .hideWallpapersLocked (w );
1069+
10751070 // If we are waiting for this window to handle an
10761071 // orientation change, well, it is hidden, so
10771072 // doesn't really matter. Note that this does
0 commit comments