Merge "NullPointerException when retriving wallpaper page areas" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6a72ef35a7
@@ -1570,6 +1570,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
+ page.getBitmap().getWidth() + " x " + page.getBitmap().getHeight());
|
+ page.getBitmap().getWidth() + " x " + page.getBitmap().getHeight());
|
||||||
}
|
}
|
||||||
for (RectF area: page.getAreas()) {
|
for (RectF area: page.getAreas()) {
|
||||||
|
if (area == null) continue;
|
||||||
RectF subArea = generateSubRect(area, pageIndx, numPages);
|
RectF subArea = generateSubRect(area, pageIndx, numPages);
|
||||||
Bitmap b = page.getBitmap();
|
Bitmap b = page.getBitmap();
|
||||||
int x = Math.round(b.getWidth() * subArea.left);
|
int x = Math.round(b.getWidth() * subArea.left);
|
||||||
@@ -1933,6 +1934,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isValid(RectF area) {
|
private boolean isValid(RectF area) {
|
||||||
|
if (area == null) return false;
|
||||||
boolean valid = area.bottom > area.top && area.left < area.right
|
boolean valid = area.bottom > area.top && area.left < area.right
|
||||||
&& LOCAL_COLOR_BOUNDS.contains(area);
|
&& LOCAL_COLOR_BOUNDS.contains(area);
|
||||||
return valid;
|
return valid;
|
||||||
|
|||||||
Reference in New Issue
Block a user