Support for triggering the lockscreen while the screen is on:
Add new ALLOW_LOCK_WHILE_SCREEN_ON window manager flag, which when set
causes the window manager to put up the lockscreen after the
normal screen timeout has elapsed.
Add plumbing to pass PowerManager.userActivity() to the window manager policy.
Change-Id: I05adc52bad39c56031a08e8ec3cbcf5c2d9b9827
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 1d14e5e..88aadbd 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -2385,7 +2385,8 @@
// to provide the correct semantics while starting.
final int mask =
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
- | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
+ | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
+ | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON;
WindowManager.LayoutParams sa = win.mAppToken.startingWindow.mAttrs;
sa.flags = (sa.flags&~mask) | (win.mAttrs.flags&mask);
}