From 9fc02de33dc3dae621c48795cfc3b2e2bd21000a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeanette=20L=C3=B6fgren?= Date: Tue, 19 Nov 2013 09:04:33 +0100 Subject: [PATCH] Prevent Lockscreen album art from activating FLAG_KEEP_SCREEN_ON This is a small fix to the showWallpaper method, in which a power consumption problem has been introduced. This showWallpaper method toggles the window flag FLAG_SHOW_WALLPAPER, when album art is being shown in Lockscreen. It is important to set pixel format to PixelFormat.OPAQUE if flag FLAG_SHOW_WALLPAPER is not being set. If not, an application that uses window flag FLAG_KEEP_SCREEN_ON will prevent the keyguard from going to sleep and drain battery. Change-Id: I1808be28047977ae5ac4dd1168ea25cac8a55a78 --- .../Keyguard/src/com/android/keyguard/KeyguardViewManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java index 6aa0a4bfd1c78..7d0059f235b85 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java @@ -388,6 +388,7 @@ public class KeyguardViewManager { } else { mWindowLayoutParams.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; } + mWindowLayoutParams.format = show ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE; mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); }