Merge "NO PARTIAL RERUN: Do not return recycled bitmaps" into pi-dev

am: 6f34a9b2d3

Change-Id: I2068bb87657abf2c36af2026b351122d2758f96d
This commit is contained in:
Lucas Dupin
2018-04-09 07:50:00 -07:00
committed by android-build-merger
2 changed files with 3 additions and 8 deletions

View File

@@ -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;

View File

@@ -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);
mWallpaperManager.forgetLoadedWallpaper();
}
private void scheduleUnloadWallpaper() {