summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeanette Löfgren <jeanette.lofgren@sonymobile.com> 2013-11-19 09:04:33 +0100
committer Takeshi Aimi <takeshi.aimi@sonymobile.com> 2014-02-15 02:36:57 +0900
commit9fc02de33dc3dae621c48795cfc3b2e2bd21000a (patch)
treeb0ca321f67b605852925f6b46d49559cd1b4bebe
parentfa8f95e9b96e3a12e98269c8a31ed34df6a323ca (diff)
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
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
index 6aa0a4bfd1c7..7d0059f235b8 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);
}