summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@google.com>2017-08-23 18:41:49 -0700
committerDavid Stevens <stevensd@google.com>2017-09-12 12:19:50 -0700
commit53a39eacc28b8e022499a208ff74b11e260ea204 (patch)
tree3dc226962d6066dcb471b8942d17fff3f3b808ee /packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
parent9ac371a81e7d144a8e31f77b085867a92bfd2bd5 (diff)
Handle showWhenLocked on secondary displays
The keyguard has windows on the default display and the remote display selected by MediaRouter. Keyguard occlusion only applies to the default display. To make the activity showWhenLocked flag work on secondary displays, pass the display id of the locked secondary display from the SystemUi to KeyguardController and make its isKeyguardShowing method take a displayId. Test: android.server.cts.ActivityManagerDisplayTests Test: #testSecondaryDisplayShowWhenLocked Bug: 64994006 Change-Id: Ib31fc76e9df469e97a59a181f09d457ceed4ef5f
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
index 8de1d317c5ed..2bc0e45c725d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
@@ -15,6 +15,8 @@
*/
package com.android.keyguard;
+import static android.view.Display.INVALID_DISPLAY;
+
import android.app.Presentation;
import android.content.Context;
import android.content.DialogInterface;
@@ -28,16 +30,21 @@ import android.view.Display;
import android.view.View;
import android.view.WindowManager;
+// TODO(multi-display): Support multiple external displays
public class KeyguardDisplayManager {
protected static final String TAG = "KeyguardDisplayManager";
private static boolean DEBUG = KeyguardConstants.DEBUG;
+
+ private final ViewMediatorCallback mCallback;
+ private final MediaRouter mMediaRouter;
+ private final Context mContext;
+
Presentation mPresentation;
- private MediaRouter mMediaRouter;
- private Context mContext;
private boolean mShowing;
- public KeyguardDisplayManager(Context context) {
+ public KeyguardDisplayManager(Context context, ViewMediatorCallback callback) {
mContext = context;
+ mCallback = callback;
mMediaRouter = (MediaRouter) mContext.getSystemService(Context.MEDIA_ROUTER_SERVICE);
}
@@ -90,6 +97,7 @@ public class KeyguardDisplayManager {
};
protected void updateDisplays(boolean showing) {
+ Presentation originalPresentation = mPresentation;
if (showing) {
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(
MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY);
@@ -121,6 +129,13 @@ public class KeyguardDisplayManager {
mPresentation = null;
}
}
+
+ // mPresentation is only updated when the display changes
+ if (mPresentation != originalPresentation) {
+ final int displayId = mPresentation != null
+ ? mPresentation.getDisplay().getDisplayId() : INVALID_DISPLAY;
+ mCallback.onSecondaryDisplayShowingChanged(displayId);
+ }
}
private final static class KeyguardPresentation extends Presentation {