Merge "Adjust wallpaper-restore acceptance criteria" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
758f45217d
@@ -102,9 +102,8 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu
|
|||||||
final Display d = wm.getDefaultDisplay();
|
final Display d = wm.getDefaultDisplay();
|
||||||
final Point size = new Point();
|
final Point size = new Point();
|
||||||
d.getSize(size);
|
d.getSize(size);
|
||||||
mDesiredMinWidth = size.x;
|
mDesiredMinWidth = Math.min(size.x, size.y);
|
||||||
mDesiredMinHeight = (double) wpm.getDesiredMinimumHeight();
|
mDesiredMinHeight = (double) wpm.getDesiredMinimumHeight();
|
||||||
|
|
||||||
if (mDesiredMinHeight <= 0) {
|
if (mDesiredMinHeight <= 0) {
|
||||||
mDesiredMinHeight = size.y;
|
mDesiredMinHeight = size.y;
|
||||||
}
|
}
|
||||||
@@ -149,9 +148,13 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu
|
|||||||
// We accept any wallpaper that is at least as wide as our preference
|
// We accept any wallpaper that is at least as wide as our preference
|
||||||
// (i.e. wide enough to fill the screen), and is within a comfortable
|
// (i.e. wide enough to fill the screen), and is within a comfortable
|
||||||
// factor of the target height, to avoid significant clipping/scaling/
|
// factor of the target height, to avoid significant clipping/scaling/
|
||||||
// letterboxing.
|
// letterboxing. At this point we know that mDesiredMinWidth is the
|
||||||
|
// smallest dimension, regardless of current orientation, so we can
|
||||||
|
// safely require that the candidate's width and height both exceed
|
||||||
|
// that hard minimum.
|
||||||
final double heightRatio = mDesiredMinHeight / options.outHeight;
|
final double heightRatio = mDesiredMinHeight / options.outHeight;
|
||||||
if (options.outWidth < mDesiredMinWidth
|
if (options.outWidth < mDesiredMinWidth
|
||||||
|
|| options.outHeight < mDesiredMinWidth
|
||||||
|| heightRatio >= MAX_HEIGHT_RATIO
|
|| heightRatio >= MAX_HEIGHT_RATIO
|
||||||
|| heightRatio <= MIN_HEIGHT_RATIO) {
|
|| heightRatio <= MIN_HEIGHT_RATIO) {
|
||||||
// Not wide enough for the screen, or too short/tall to be a good fit
|
// Not wide enough for the screen, or too short/tall to be a good fit
|
||||||
|
|||||||
Reference in New Issue
Block a user