Wallpaper picker fixes
Do not keep display size cached, if
we keep the size cached in a singleton then config changes
won't be reflected and WPP will crash.
Also default to minZoom in PreviewFragment.
Fixes: 117099627
Fixes: 117559479
Change-Id: I4da7f8df130cc093883c18ae329d9677c6b2d05a
diff --git a/src/com/android/wallpaper/picker/PreviewFragment.java b/src/com/android/wallpaper/picker/PreviewFragment.java
index 33767ee..1c3c56b 100755
--- a/src/com/android/wallpaper/picker/PreviewFragment.java
+++ b/src/com/android/wallpaper/picker/PreviewFragment.java
@@ -794,7 +794,7 @@
centerPosition.offset( - (screenToCropSurfacePosition.x + cropSurfaceToWallpaperPosition.x),
- (screenToCropSurfacePosition.y + cropSurfaceToWallpaperPosition.y));
- mFullResImageView.setScaleAndCenter(defaultWallpaperZoom, centerPosition);
+ mFullResImageView.setScaleAndCenter(minWallpaperZoom, centerPosition);
}
protected Rect calculateCropRect() {
diff --git a/src/com/android/wallpaper/util/ScreenSizeCalculator.java b/src/com/android/wallpaper/util/ScreenSizeCalculator.java
index 49148c3..d55cf99 100755
--- a/src/com/android/wallpaper/util/ScreenSizeCalculator.java
+++ b/src/com/android/wallpaper/util/ScreenSizeCalculator.java
@@ -73,16 +73,16 @@
private Point getPortraitScreenSize(Display display) {
if (mPortraitScreenSize == null) {
mPortraitScreenSize = new Point();
- writeDisplaySizeToPoint(display, mPortraitScreenSize);
}
+ writeDisplaySizeToPoint(display, mPortraitScreenSize);
return mPortraitScreenSize;
}
private Point getLandscapeScreenSize(Display display) {
if (mLandscapeScreenSize == null) {
mLandscapeScreenSize = new Point();
- writeDisplaySizeToPoint(display, mLandscapeScreenSize);
}
+ writeDisplaySizeToPoint(display, mLandscapeScreenSize);
return mLandscapeScreenSize;
}