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

Commit bf2b8afa authored by Yasin Kilicdere's avatar Yasin Kilicdere Committed by Android (Google) Code Review
Browse files

Merge changes from topic "improve_loadWallpaper_forUserSwitch" into main

* changes:
  Optimise loading wallpaper from disk, by skipping unnecessary steps.
  Revert "Optimise loading wallpaper from disk to memory using chunks."
parents 115323e6 16253de0
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -744,9 +744,11 @@ public class WallpaperManager {
                        params, userId, /* getCropped = */ true);
                Trace.endSection();

                if (pfd != null) {
                if (pfd == null) {
                    return null;
                }
                try (InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) {
                        ImageDecoder.Source src = ImageDecoder.createSource(is.readAllBytes());
                    ImageDecoder.Source src = ImageDecoder.createSource(context.getResources(), is);
                    return ImageDecoder.decodeBitmap(src, ((decoder, info, source) -> {
                        // Mutable and hardware config can't be set at the same time.
                        decoder.setMutableRequired(!hardware);
@@ -758,7 +760,6 @@ public class WallpaperManager {
                } catch (OutOfMemoryError | IOException e) {
                    Log.w(TAG, "Can't decode file", e);
                }
                }
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }