NullPointerException when retriving wallpaper page areas
Fixes: 191293701 Test: manual Change-Id: I18c4d627f29848b50bb8c7dc2b4a02627ff3a89b
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user