Merge "Use parent frame to update wallpaper offset" into tm-qpr-dev am: 2bf1f42576

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20880686

Change-Id: I675362e750b4c2e8936bd44f6141a20c33b7d200
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2023-01-11 07:59:50 +00:00
committed by Automerger Merge Worker
3 changed files with 6 additions and 9 deletions

View File

@@ -371,7 +371,7 @@ class WallpaperController {
boolean updateWallpaperOffset(WindowState wallpaperWin, boolean sync) { boolean updateWallpaperOffset(WindowState wallpaperWin, boolean sync) {
// Size of the display the wallpaper is rendered on. // Size of the display the wallpaper is rendered on.
final Rect lastWallpaperBounds = wallpaperWin.getLastReportedBounds(); final Rect lastWallpaperBounds = wallpaperWin.getParentFrame();
// Full size of the wallpaper (usually larger than bounds above to parallax scroll when // Full size of the wallpaper (usually larger than bounds above to parallax scroll when
// swiping through Launcher pages). // swiping through Launcher pages).
final Rect wallpaperFrame = wallpaperWin.getFrame(); final Rect wallpaperFrame = wallpaperWin.getFrame();

View File

@@ -3081,12 +3081,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return mLastReportedConfiguration.getMergedConfiguration(); return mLastReportedConfiguration.getMergedConfiguration();
} }
/** Returns the last window configuration bounds reported to the client. */
Rect getLastReportedBounds() {
final Rect bounds = getLastReportedConfiguration().windowConfiguration.getBounds();
return !bounds.isEmpty() ? bounds : getBounds();
}
void adjustStartingWindowFlags() { void adjustStartingWindowFlags() {
if (mAttrs.type == TYPE_BASE_APPLICATION && mActivityRecord != null if (mAttrs.type == TYPE_BASE_APPLICATION && mActivityRecord != null
&& mActivityRecord.mStartingWindow != null) { && mActivityRecord.mStartingWindow != null) {
@@ -4421,6 +4415,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
pw.print("null"); pw.print("null");
} }
if (mXOffset != 0 || mYOffset != 0) {
pw.println(prefix + "mXOffset=" + mXOffset + " mYOffset=" + mYOffset);
}
if (mHScale != 1 || mVScale != 1) { if (mHScale != 1 || mVScale != 1) {
pw.println(prefix + "mHScale=" + mHScale pw.println(prefix + "mHScale=" + mHScale
+ " mVScale=" + mVScale); + " mVScale=" + mVScale);
@@ -5573,7 +5570,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
mSurfacePosition); mSurfacePosition);
if (mWallpaperScale != 1f) { if (mWallpaperScale != 1f) {
final Rect bounds = getLastReportedBounds(); final Rect bounds = getParentFrame();
Matrix matrix = mTmpMatrix; Matrix matrix = mTmpMatrix;
matrix.setTranslate(mXOffset, mYOffset); matrix.setTranslate(mXOffset, mYOffset);
matrix.postScale(mWallpaperScale, mWallpaperScale, bounds.exactCenterX(), matrix.postScale(mWallpaperScale, mWallpaperScale, bounds.exactCenterX(),

View File

@@ -391,7 +391,7 @@ public class WallpaperControllerTests extends WindowTestsBase {
dc.updateOrientation(); dc.updateOrientation();
dc.sendNewConfiguration(); dc.sendNewConfiguration();
spyOn(wallpaperWindow); spyOn(wallpaperWindow);
doReturn(new Rect(0, 0, width, height)).when(wallpaperWindow).getLastReportedBounds(); doReturn(new Rect(0, 0, width, height)).when(wallpaperWindow).getParentFrame();
} }
@Test @Test