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

Commit 8485fedf authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Git Automerger
Browse files

am d77b0dfd: am 7c65585f: Merge "Make sure OutOfMemoryError is handled by WallpaperManager"

Merge commit 'd77b0dfd'

* commit 'd77b0dfd':
  Make sure OutOfMemoryError is handled by WallpaperManager
parents 082b8334 d77b0dfd
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -235,8 +235,13 @@ public class WallpaperManager {
                    if (width <= 0 || height <= 0) {
                        // Degenerate case: no size requested, just load
                        // bitmap as-is.
                        Bitmap bm = BitmapFactory.decodeFileDescriptor(
                        Bitmap bm = null;
                        try {
                            bm = BitmapFactory.decodeFileDescriptor(
                                   fd.getFileDescriptor(), null, null);
                        } catch (OutOfMemoryError e) {
                            Log.w(TAG, "Can't decode file", e);
                        }
                        try {
                            fd.close();
                        } catch (IOException e) {
@@ -277,7 +282,12 @@ public class WallpaperManager {
                    if (width <= 0 || height <= 0) {
                        // Degenerate case: no size requested, just load
                        // bitmap as-is.
                        Bitmap bm = BitmapFactory.decodeStream(is, null, null);
                        Bitmap bm = null;
                        try {
                            bm = BitmapFactory.decodeStream(is, null, null);
                        } catch (OutOfMemoryError e) {
                            Log.w(TAG, "Can't decode stream", e);
                        }
                        try {
                            is.close();
                        } catch (IOException e) {