summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/Window.java
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-05-31 17:28:29 -0700
committerScott Mertz <scott@cyngn.com>2016-05-31 17:41:40 -0700
commit44e91e0ed2b3056e30ccfbb009be5f19495061ce (patch)
tree4b1646abc97826072927489ae3e1eb87b9769fe4 /core/java/android/view/Window.java
parent70d2082f7d7253f8cf5d578507f44fd6e28ce706 (diff)
downloadframeworks_base-44e91e0ed2b3056e30ccfbb009be5f19495061ce.zip
frameworks_base-44e91e0ed2b3056e30ccfbb009be5f19495061ce.tar.gz
frameworks_base-44e91e0ed2b3056e30ccfbb009be5f19495061ce.tar.bz2
fw: reintroduce PRIVATE_FLAG_PREVENT_POWER_KEY
Switching the PREVENT_SYSTEM_KEYS forces the application to handle every system key. Some apps may not want to handle every single key, so allow them to just handle the power key. CYNGNOS-2958 Change-Id: I43fd65e67b909e6d52548f110ff9997b829b3e15
Diffstat (limited to 'core/java/android/view/Window.java')
-rw-r--r--core/java/android/view/Window.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 5811ef9..65577f0 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -869,7 +869,10 @@ public abstract class Window {
}
private void setPrivateFlags(int flags, int mask) {
- if ((flags & mask & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_SYSTEM_KEYS) != 0){
+ int preventFlags = WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY |
+ WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_SYSTEM_KEYS;
+
+ if ((flags & mask & preventFlags) != 0) {
mContext.enforceCallingOrSelfPermission("android.permission.PREVENT_SYSTEM_KEYS",
"No permission to prevent system key");
}