OSDN Git Service

SystemUI: Recycle the old wallpaper background bitmap after we choose a new wallpaper.
authorjshe32X <jianchunx.shen@intel.com>
Thu, 24 Oct 2013 04:57:09 +0000 (12:57 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 22 Dec 2015 04:13:52 +0000 (12:13 +0800)
BZ: 101064

RootCause: ImageWallpaper didn't call old background bitmap's recycle before
           set it to null.

Category: aosp improvement
Domain: AOSP-Framework-Media
Origin: internal
Upstream-Candidate: yes

Orig-Change-Id: I27f6971a3edd26472b69e59b542b27fd7c8e7b90
Change-Id: Ice59aea79f8137d5995d7a5ce9a6ed7903750d30
Signed-off-by: jshe32X<jianchunx.shen@intel.com>
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java

index 44789ea..4d398c0 100644 (file)
@@ -182,7 +182,10 @@ public class ImageWallpaper extends WallpaperService {
         @Override
         public void onDestroy() {
             super.onDestroy();
-            mBackground = null;
+            if (mBackground != null) {
+                mBackground.recycle();
+                mBackground = null;
+            }
             mWallpaperManager.forgetLoadedWallpaper();
         }