Loading services/core/java/com/android/server/wm/DisplayContent.java +18 −21 Original line number Diff line number Diff line Loading @@ -1004,6 +1004,24 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mTmpApplySurfaceChangesTransactionState.obscured; final RootWindowContainer root = mWmService.mRoot; if (w.mHasSurface) { // Take care of the window being ready to display. final boolean committed = w.mWinAnimator.commitFinishDrawingLocked(); if (isDefaultDisplay && committed) { if (w.hasWallpaper()) { ProtoLog.v(WM_DEBUG_WALLPAPER, "First draw done in potential wallpaper target %s", w); mWallpaperMayChange = true; pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) { surfacePlacer.debugLayoutRepeats( "wallpaper and commitFinishDrawingLocked true", pendingLayoutChanges); } } } } // Update effect. w.mObscured = mTmpApplySurfaceChangesTransactionState.obscured; Loading Loading @@ -1090,30 +1108,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp w.handleWindowMovedIfNeeded(); final WindowStateAnimator winAnimator = w.mWinAnimator; //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing"); w.resetContentChanged(); // Moved from updateWindowsAndWallpaperLocked(). if (w.mHasSurface) { // Take care of the window being ready to display. final boolean committed = winAnimator.commitFinishDrawingLocked(); if (isDefaultDisplay && committed) { if (w.hasWallpaper()) { ProtoLog.v(WM_DEBUG_WALLPAPER, "First draw done in potential wallpaper target %s", w); mWallpaperMayChange = true; pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) { surfacePlacer.debugLayoutRepeats( "wallpaper and commitFinishDrawingLocked true", pendingLayoutChanges); } } } } final ActivityRecord activity = w.mActivityRecord; if (activity != null && activity.isVisibleRequested()) { activity.updateLetterboxSurface(w); Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,21 @@ public class DisplayContentTests extends WindowTestsBase { assertFalse(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } @Test public void testDisplayHasContent() { final WindowState window = createWindow(null, TYPE_APPLICATION_OVERLAY, "window"); setDrawnState(WindowStateAnimator.COMMIT_DRAW_PENDING, window); assertFalse(mDisplayContent.getLastHasContent()); // The pending draw state should be committed and the has-content state is also updated. mDisplayContent.applySurfaceChangesTransaction(); assertTrue(window.isDrawn()); assertTrue(mDisplayContent.getLastHasContent()); // If the only window is no longer visible, has-content will be false. setDrawnState(WindowStateAnimator.NO_SURFACE, window); mDisplayContent.applySurfaceChangesTransaction(); assertFalse(mDisplayContent.getLastHasContent()); } @Test public void testImeIsAttachedToDisplayForLetterboxedApp() { final DisplayContent dc = mDisplayContent; Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +18 −21 Original line number Diff line number Diff line Loading @@ -1004,6 +1004,24 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mTmpApplySurfaceChangesTransactionState.obscured; final RootWindowContainer root = mWmService.mRoot; if (w.mHasSurface) { // Take care of the window being ready to display. final boolean committed = w.mWinAnimator.commitFinishDrawingLocked(); if (isDefaultDisplay && committed) { if (w.hasWallpaper()) { ProtoLog.v(WM_DEBUG_WALLPAPER, "First draw done in potential wallpaper target %s", w); mWallpaperMayChange = true; pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) { surfacePlacer.debugLayoutRepeats( "wallpaper and commitFinishDrawingLocked true", pendingLayoutChanges); } } } } // Update effect. w.mObscured = mTmpApplySurfaceChangesTransactionState.obscured; Loading Loading @@ -1090,30 +1108,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp w.handleWindowMovedIfNeeded(); final WindowStateAnimator winAnimator = w.mWinAnimator; //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing"); w.resetContentChanged(); // Moved from updateWindowsAndWallpaperLocked(). if (w.mHasSurface) { // Take care of the window being ready to display. final boolean committed = winAnimator.commitFinishDrawingLocked(); if (isDefaultDisplay && committed) { if (w.hasWallpaper()) { ProtoLog.v(WM_DEBUG_WALLPAPER, "First draw done in potential wallpaper target %s", w); mWallpaperMayChange = true; pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) { surfacePlacer.debugLayoutRepeats( "wallpaper and commitFinishDrawingLocked true", pendingLayoutChanges); } } } } final ActivityRecord activity = w.mActivityRecord; if (activity != null && activity.isVisibleRequested()) { activity.updateLetterboxSurface(w); Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,21 @@ public class DisplayContentTests extends WindowTestsBase { assertFalse(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } @Test public void testDisplayHasContent() { final WindowState window = createWindow(null, TYPE_APPLICATION_OVERLAY, "window"); setDrawnState(WindowStateAnimator.COMMIT_DRAW_PENDING, window); assertFalse(mDisplayContent.getLastHasContent()); // The pending draw state should be committed and the has-content state is also updated. mDisplayContent.applySurfaceChangesTransaction(); assertTrue(window.isDrawn()); assertTrue(mDisplayContent.getLastHasContent()); // If the only window is no longer visible, has-content will be false. setDrawnState(WindowStateAnimator.NO_SURFACE, window); mDisplayContent.applySurfaceChangesTransaction(); assertFalse(mDisplayContent.getLastHasContent()); } @Test public void testImeIsAttachedToDisplayForLetterboxedApp() { final DisplayContent dc = mDisplayContent; Loading