summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
diff options
context:
space:
mode:
authorwilsonshih <wilsonshih@google.com>2018-09-26 16:17:59 +0800
committerwilsonshih <wilsonshih@google.com>2018-11-06 14:27:21 +0800
commite7903ea985debe04a34a542fa1b322bc15b485a0 (patch)
tree2e790bfd3d2a2b27d121ec54542e2f794c64075e /packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
parent44f74d111f08704cae5a10b6c03db78748419816 (diff)
Support show KeyguardPresentation on all public displays.
Support show keyguard presentation on all public displays when Keyguard is show. Modify API ActivityTaskManager#setLockScreenShown, extends to multi-displayIds. bug: 111955725 Test: Manual test with chromecast. Test: atest SystemUITests Test: atest ActivityManagerMultiDisplayTests Test: atest ActivityManagerDisplayKeyguardTests Change-Id: I9967e1b1adcb796593332b46853a10101e206013
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
index 50b98a10b7f0..79966f78373c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
@@ -17,6 +17,8 @@
package com.android.keyguard;
import static android.app.slice.Slice.HINT_LIST_ITEM;
+import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.Display.INVALID_DISPLAY;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
@@ -80,6 +82,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
private float mDarkAmount = 0;
private LiveData<Slice> mLiveData;
+ private int mDisplayId = INVALID_DISPLAY;
private int mIconSize;
/**
* Runnable called whenever the view contents change.
@@ -129,6 +132,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
protected void onAttachedToWindow() {
super.onAttachedToWindow();
+ mDisplayId = getDisplay().getDisplayId();
// Make sure we always have the most current slice
mLiveData.observeForever(this);
Dependency.get(ConfigurationController.class).addCallback(this);
@@ -138,7 +142,10 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
- mLiveData.removeObserver(this);
+ // TODO(b/117344873) Remove below work around after this issue be fixed.
+ if (mDisplayId == DEFAULT_DISPLAY) {
+ mLiveData.removeObserver(this);
+ }
Dependency.get(ConfigurationController.class).removeCallback(this);
}