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

Commit 61df45cd authored by Lucas Dupin's avatar Lucas Dupin
Browse files

NO PARTIAL RERUN: Do not return recycled bitmaps

There's also no need to offload WallpaperManager#forgetLoadedBitmap
because Bitmap#recycle is asynchronous - and the whole method is
synchronized.

Fixes 77597550
Test: atest cts/tests/framework/base/activitymanager/src/android/server/am/ActivityManagerMultiDisplayTests.java

Change-Id: I88014e21bd05e10c2f524393bb637596708e4e63
parent 4f9d750e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -401,7 +401,8 @@ public class WallpaperManager {
                }
            }
            synchronized (this) {
                if (mCachedWallpaper != null && mCachedWallpaperUserId == userId) {
                if (mCachedWallpaper != null && mCachedWallpaperUserId == userId
                        && !mCachedWallpaper.isRecycled()) {
                    return mCachedWallpaper;
                }
                mCachedWallpaper = null;
+1 −7
Original line number Diff line number Diff line
@@ -444,13 +444,7 @@ public class ImageWallpaper extends WallpaperService {
            final Surface surface = getSurfaceHolder().getSurface();
            surface.hwuiDestroy();

            mLoader = new AsyncTask<Void, Void, Bitmap>() {
                @Override
                protected Bitmap doInBackground(Void... params) {
            mWallpaperManager.forgetLoadedWallpaper();
                    return null;
                }
            }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        }

        private void scheduleUnloadWallpaper() {