summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-12-09 18:29:42 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-12-18 15:04:33 -0800
commit753a484781e694e79809ba569c972008b65a962f (patch)
tree6d54425aa98cbbd0a0df0cf73c0d6272761228d0 /services
parentf128c0c2f9ea96b59f7fc7b5f2398ba420726a73 (diff)
downloadframeworks_base-753a484781e694e79809ba569c972008b65a962f.zip
frameworks_base-753a484781e694e79809ba569c972008b65a962f.tar.gz
frameworks_base-753a484781e694e79809ba569c972008b65a962f.tar.bz2
Lockscreen: Introduce window type TYPE_KEYGUARD_PANEL
This window type will be used by third party keyguard components so that they can be layered within the keyguard while running in their own process. This window type will use the same Z ordering as TYPE_STATUS_BAR_SUB_PANEL, which is currently unused. Change-Id: Ie18caf12a55ba79a5c56a36ca79b3a6e377d7529
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java24
-rw-r--r--services/core/java/com/android/server/wm/WindowAnimator.java3
2 files changed, 25 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index dd4d3ab..fb6ae75 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -372,6 +372,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int[] mNavigationBarHeightForRotation = new int[4];
int[] mNavigationBarWidthForRotation = new int[4];
+ WindowState mKeyguardPanel;
+
KeyguardServiceDelegate mKeyguardDelegate;
final Runnable mWindowManagerDrawCallback = new Runnable() {
@Override
@@ -2359,6 +2361,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
permission = android.Manifest.permission.SYSTEM_ALERT_WINDOW;
outAppOp[0] = AppOpsManager.OP_SYSTEM_ALERT_WINDOW;
break;
+ case TYPE_KEYGUARD_PANEL:
+ permission =
+ org.cyanogenmod.platform.internal.Manifest.permission.THIRD_PARTY_KEYGUARD;
+ break;
default:
permission = android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
}
@@ -2440,6 +2446,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case TYPE_SYSTEM_DIALOG:
case TYPE_VOLUME_OVERLAY:
case TYPE_PRIVATE_PRESENTATION:
+ case TYPE_KEYGUARD_PANEL:
break;
}
@@ -2578,6 +2585,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// the safety window that shows behind keyguard while keyguard is starting
return 14;
case TYPE_STATUS_BAR_SUB_PANEL:
+ case TYPE_KEYGUARD_PANEL:
return 15;
case TYPE_STATUS_BAR:
return 16;
@@ -2918,6 +2926,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
android.Manifest.permission.STATUS_BAR_SERVICE,
"PhoneWindowManager");
break;
+ case TYPE_KEYGUARD_PANEL:
+ mContext.enforceCallingOrSelfPermission(
+ org.cyanogenmod.platform.internal.Manifest.permission.THIRD_PARTY_KEYGUARD,
+ "PhoneWindowManager");
+ if (mKeyguardPanel != null) {
+ return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON;
+ }
+ mKeyguardPanel = win;
+ break;
case TYPE_KEYGUARD_SCRIM:
if (mKeyguardScrim != null) {
return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON;
@@ -2938,9 +2955,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} else if (mKeyguardScrim == win) {
Log.v(TAG, "Removing keyguard scrim");
mKeyguardScrim = null;
- } if (mNavigationBar == win) {
+ } else if (mNavigationBar == win) {
mNavigationBar = null;
mNavigationBarController.setWindow(null);
+ } else if (mKeyguardPanel == win) {
+ mKeyguardPanel = null;
}
}
@@ -4743,7 +4762,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// gets everything, period.
if (attrs.type == TYPE_STATUS_BAR_PANEL
|| attrs.type == TYPE_STATUS_BAR_SUB_PANEL
- || attrs.type == TYPE_VOLUME_OVERLAY) {
+ || attrs.type == TYPE_VOLUME_OVERLAY
+ || attrs.type == TYPE_KEYGUARD_PANEL) {
pf.left = df.left = of.left = cf.left = hasNavBar
? mDockLeft : mUnrestrictedScreenLeft;
pf.top = df.top = of.top = cf.top = mUnrestrictedScreenTop;
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index 5d9878f..5de1837 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -36,6 +36,7 @@ import android.util.SparseArray;
import android.util.TimeUtils;
import android.view.Display;
import android.view.SurfaceControl;
+import android.view.WindowManager;
import android.view.WindowManagerPolicy;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@@ -209,6 +210,8 @@ public class WindowAnimator {
allowWhenLocked |= (win.mIsImWindow || imeTarget == win) && showImeOverKeyguard;
// Show SHOW_WHEN_LOCKED windows that turn on the screen
allowWhenLocked |= (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0 && win.mTurnOnScreen;
+ // Show windows that use TYPE_STATUS_BAR_SUB_PANEL when locked
+ allowWhenLocked |= win.mAttrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD_PANEL;
if (appShowWhenLocked != null) {
allowWhenLocked |= appShowWhenLocked == win.mAppToken