From 7670b2bd49915509dac72c98f2b6a2c1172c52bf Mon Sep 17 00:00:00 2001 From: jshe32X Date: Thu, 24 Oct 2013 12:57:09 +0800 Subject: [PATCH] NULL previous background bitmap upon changing wallpaper Step to reproduce it on Nexus 10 with 4.4.2(KOT49H): 1. Long press on home screen. 2. Choose wallpaper from Wallpapers. 3. Select new wallpaper and set it. 4. Repeat step 1-3 several times. See black background instead of the wallpaper. There are two binder objects who hold reference to the ImageWallpaper$DrawableEngine, which keeps the big chunk bitmap from being recycled. One is WallpaperService$IWallpaperEngineWrapper. The client references went away slowly, maybe several minutes after changing wallpaper. Then the finalizer has to been executed to GC it. The other one is WallpaperService$Engine$BaseIWindow. Don't know who still held reference to it even after the window was removed. Anyway, let the bitmap be GCed first. Change-Id: I27f6971a3edd26472b69e59b542b27fd7c8e7b90 Signed-off-by: jshe32X Signed-off-by: Guobin Zhang --- packages/SystemUI/src/com/android/systemui/ImageWallpaper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 4b0c2cb31ee8..d9404066f822 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -202,6 +202,7 @@ public class ImageWallpaper extends WallpaperService { if (mReceiver != null) { unregisterReceiver(mReceiver); } + mBackground = null; } @Override -- 2.11.0