From ed0e1a68a437979e399724ca17f422add80bd0e4 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Fri, 13 May 2016 17:45:41 -0700 Subject: [PATCH] Don't throw away wallpaper bitmap just because we are hidden. TRIM_MEMORY_UI_HIDDEN > TRIM_MEMORY_RUNNING constants, so we only need to throw away the wallpaper if we are actually running low on memory. Bug: 28769940 Change-Id: I8aa27d081bbcc2eff553e9420b2b9b0920f3781f --- .../SystemUI/src/com/android/systemui/ImageWallpaper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 0962d8488188e..a0d9dfe1c1c18 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -166,8 +166,9 @@ public class ImageWallpaper extends WallpaperService { } public void trimMemory(int level) { - if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW && - mBackground != null) { + if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW + && level <= ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL + && mBackground != null) { if (DEBUG) { Log.d(TAG, "trimMemory"); }