Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f14a994e authored by Roman Birg's avatar Roman Birg
Browse files

WallpaperCropper: do not display null bitmaps



It is possible that themes can include a corrupted bitmap,
and the lockscreen will try and display a NULL image resulting in an
empty thumbnail and applying it will cause the app to crash.

Change-Id: Ie0770486a9d58050a5f296a219d844a39937421e
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 82dd9be8
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -1337,10 +1337,11 @@ public class LockWallpaperPickerActivity extends WallpaperCropActivity {
                boolean isLegacy = c.getInt(c.getColumnIndexOrThrow(
                        ThemesColumns.IS_LEGACY_THEME)) == 1;
                bmp = getThemeWallpaper(this, "wallpapers", pkgName, isLegacy, true /* thumb*/);
                if (bmp != null) {
                    themeWallpapers.add(
                            new ThemeWallpaperInfo(this, pkgName, isLegacy,
                                    new BitmapDrawable(getResources(), bmp)));
                    if (bmp != null) {

                    Log.d("", String.format("Loaded bitmap of size %dx%d for %s",
                            bmp.getWidth(), bmp.getHeight(), pkgName));
                }
@@ -1366,10 +1367,11 @@ public class LockWallpaperPickerActivity extends WallpaperCropActivity {
            while (c.moveToNext()) {
                String pkgName = c.getString(c.getColumnIndexOrThrow(ThemesColumns.PKG_NAME));
                bmp = getThemeWallpaper(this, "lockscreen", pkgName, false, true /* thumb*/);
                if (bmp != null) {
                    themeWallpapers.add(
                            new ThemeLockWallpaperInfo(this, pkgName,
                                    new BitmapDrawable(getResources(), bmp)));
                    if (bmp != null) {

                    Log.d("", String.format("Loaded bitmap of size %dx%d for %s",
                            bmp.getWidth(), bmp.getHeight(), pkgName));
                }