Merge "Report pending change to wallpaper when being visible" into tm-qpr-dev am: 1abdd8afcc am: 002280fe83
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21920183 Change-Id: I341ab361c65a9db9bc0c3828131e95a3d49a85dc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -4523,7 +4523,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
|
|
||||||
void requestUpdateWallpaperIfNeeded() {
|
void requestUpdateWallpaperIfNeeded() {
|
||||||
final DisplayContent dc = getDisplayContent();
|
final DisplayContent dc = getDisplayContent();
|
||||||
if (dc != null && hasWallpaper()) {
|
if (dc != null && ((mIsWallpaper && !mLastConfigReportedToClient) || hasWallpaper())) {
|
||||||
dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
|
dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
|
||||||
dc.setLayoutNeeded();
|
dc.setLayoutNeeded();
|
||||||
mWmService.mWindowPlacerLocked.requestTraversal();
|
mWmService.mWindowPlacerLocked.requestTraversal();
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import android.graphics.Rect;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.util.MergedConfiguration;
|
||||||
import android.view.DisplayCutout;
|
import android.view.DisplayCutout;
|
||||||
import android.view.DisplayInfo;
|
import android.view.DisplayInfo;
|
||||||
import android.view.DisplayShape;
|
import android.view.DisplayShape;
|
||||||
@@ -62,6 +63,7 @@ import android.view.RoundedCorners;
|
|||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.window.ClientWindowFrames;
|
||||||
|
|
||||||
import androidx.test.filters.SmallTest;
|
import androidx.test.filters.SmallTest;
|
||||||
|
|
||||||
@@ -339,6 +341,29 @@ public class WallpaperControllerTests extends WindowTestsBase {
|
|||||||
assertEquals(appWin, mDisplayContent.mWallpaperController.getWallpaperTarget());
|
assertEquals(appWin, mDisplayContent.mWallpaperController.getWallpaperTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testWallpaperReportConfigChange() {
|
||||||
|
final WindowState wallpaperWindow = createWallpaperWindow(mDisplayContent);
|
||||||
|
createWallpaperTargetWindow(mDisplayContent);
|
||||||
|
final WallpaperWindowToken wallpaperToken = wallpaperWindow.mToken.asWallpaperToken();
|
||||||
|
makeWindowVisible(wallpaperWindow);
|
||||||
|
wallpaperWindow.mLayoutSeq = mDisplayContent.mLayoutSeq;
|
||||||
|
// Assume the token was invisible and the latest config was reported.
|
||||||
|
wallpaperToken.commitVisibility(false);
|
||||||
|
wallpaperWindow.fillClientWindowFramesAndConfiguration(new ClientWindowFrames(),
|
||||||
|
new MergedConfiguration(), true /* useLatestConfig */, false /* relayoutVisible */);
|
||||||
|
assertTrue(wallpaperWindow.isLastConfigReportedToClient());
|
||||||
|
|
||||||
|
final Rect bounds = wallpaperToken.getBounds();
|
||||||
|
wallpaperToken.setBounds(new Rect(0, 0, bounds.width() / 2, bounds.height() / 2));
|
||||||
|
assertFalse(wallpaperWindow.isLastConfigReportedToClient());
|
||||||
|
// If there is a pending config change when changing to visible, it should tell the client
|
||||||
|
// to redraw by WindowState#reportResized.
|
||||||
|
wallpaperToken.commitVisibility(true);
|
||||||
|
waitUntilHandlersIdle();
|
||||||
|
assertTrue(wallpaperWindow.isLastConfigReportedToClient());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWallpaperTokenVisibility() {
|
public void testWallpaperTokenVisibility() {
|
||||||
final DisplayContent dc = mWm.mRoot.getDefaultDisplay();
|
final DisplayContent dc = mWm.mRoot.getDefaultDisplay();
|
||||||
|
|||||||
Reference in New Issue
Block a user