summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/Window.java5
-rw-r--r--core/java/android/view/WindowManager.java8
2 files changed, 11 insertions, 2 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");
}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index c7a9650..36f593e 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1157,7 +1157,13 @@ public interface WindowManager extends ViewManager {
* Window flag: Overrides default system key behavior.
* {@hide}
*/
- public static final int PRIVATE_FLAG_PREVENT_SYSTEM_KEYS = 0x20000000;
+ public static final int PRIVATE_FLAG_PREVENT_SYSTEM_KEYS = 0x10000000;
+
+ /**
+ * Window flag: Overrides default system key behavior.
+ * {@hide}
+ */
+ public static final int PRIVATE_FLAG_PREVENT_POWER_KEY = 0x20000000;
/**
* Window flag: adding additional blur layer and set this as masking layer