Merge "NullPointerException when retriving wallpaper page areas" into sc-dev am: 6a72ef35a7

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

Change-Id: Icb7278382f050411c1eedfd9e2fe5f0c544f253e
This commit is contained in:
TreeHugger Robot
2021-06-25 19:58:21 +00:00
committed by Automerger Merge Worker

View File

@@ -1570,6 +1570,7 @@ public abstract class WallpaperService extends Service {
+ page.getBitmap().getWidth() + " x " + page.getBitmap().getHeight());
}
for (RectF area: page.getAreas()) {
if (area == null) continue;
RectF subArea = generateSubRect(area, pageIndx, numPages);
Bitmap b = page.getBitmap();
int x = Math.round(b.getWidth() * subArea.left);
@@ -1933,6 +1934,7 @@ public abstract class WallpaperService extends Service {
}
private boolean isValid(RectF area) {
if (area == null) return false;
boolean valid = area.bottom > area.top && area.left < area.right
&& LOCAL_COLOR_BOUNDS.contains(area);
return valid;