summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-05-20 12:57:43 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-23 12:28:04 -0700
commit936f7e26cff0c4893a75ef18757efda0bd8d91df (patch)
tree500587b8a1b7a1af6f07f9f7263ce3bdc8c59690 /core
parent4018231a6ccc45824a7d0cff5186e379f1926fef (diff)
downloadframeworks_base-936f7e26cff0c4893a75ef18757efda0bd8d91df.zip
frameworks_base-936f7e26cff0c4893a75ef18757efda0bd8d91df.tar.gz
frameworks_base-936f7e26cff0c4893a75ef18757efda0bd8d91df.tar.bz2
fw: Repurpose PREVENT_POWER_KEY for preventing multiple system keys.
Allows applications like camera, and various testing applications, to intercept certain system keys to verify behavior or leverage it in creative ways. Limited to signature/privileged. Change-Id: Iacd8735af2aabafbf1fc062d8c565b7102dc6865 TICKET: FEIJ-522
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/Window.java6
-rw-r--r--core/java/android/view/WindowManager.java4
-rw-r--r--core/res/AndroidManifest.xml4
3 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 3616622..5811ef9 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -869,9 +869,9 @@ public abstract class Window {
}
private void setPrivateFlags(int flags, int mask) {
- if ((flags & mask & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY) != 0){
- mContext.enforceCallingOrSelfPermission("android.permission.PREVENT_POWER_KEY",
- "No permission to prevent power key");
+ if ((flags & mask & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_SYSTEM_KEYS) != 0){
+ mContext.enforceCallingOrSelfPermission("android.permission.PREVENT_SYSTEM_KEYS",
+ "No permission to prevent system key");
}
final WindowManager.LayoutParams attrs = getAttributes();
attrs.privateFlags = (attrs.privateFlags & ~mask) | (flags & mask);
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 1125b44..c7a9650 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1154,10 +1154,10 @@ public interface WindowManager extends ViewManager {
public static final int PRIVATE_FLAG_WAS_NOT_FULLSCREEN = 0x02000000;
/**
- * Window flag: Overrides default power key behavior
+ * Window flag: Overrides default system key behavior.
* {@hide}
*/
- public static final int PRIVATE_FLAG_PREVENT_POWER_KEY = 0x20000000;
+ public static final int PRIVATE_FLAG_PREVENT_SYSTEM_KEYS = 0x20000000;
/**
* Window flag: adding additional blur layer and set this as masking layer
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index a6de699..ea0e39c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1239,10 +1239,10 @@
<permission android:name="android.permission.NOTIFY_PENDING_SYSTEM_UPDATE"
android:protectionLevel="signature|privileged" />
- <!-- Allows an application to override the power key action
+ <!-- Allows an application to override the system key actions
@hide <p>Not for use by third-party applications.
-->
- <permission android:name="android.permission.PREVENT_POWER_KEY"
+ <permission android:name="android.permission.PREVENT_SYSTEM_KEYS"
android:protectionLevel="signature|privileged" />
<!-- =========================================== -->