summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Pietal <mpietal@google.com>2021-08-12 18:26:15 -0400
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-08-13 19:39:54 +0000
commit2c3fcd7fd8ae1238068435f36eba3897e1005886 (patch)
tree7762520ddd0b59caab59de6e1b0b572d8ebbf97b
parent268425437440ca3e108bd76057053f59dc0ffb50 (diff)
downloadbase-2c3fcd7fd8ae1238068435f36eba3897e1005886.tar.gz
Limit keyguard views on alt displays
When casting or on other displays, the keyguard has always limited the information shown when locked. Don't show the smartspace and icons on these alternate displays Fixes: 196175396 Test: manual (cast to nest display device) Change-Id: Ied1ecff9103d8539f075785409d2951a1be21ab2 (cherry picked from commit 893286a5d4c8bac3a332b5f38a553900488ee6b1)
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java19
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java1
2 files changed, 20 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 632919ae51e4..f4a3fb236ffa 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -97,6 +97,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
private SmartspaceTransitionController mSmartspaceTransitionController;
+ private boolean mOnlyClock = false;
+
@Inject
public KeyguardClockSwitchController(
KeyguardClockSwitch keyguardClockSwitch,
@@ -129,6 +131,13 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
}
/**
+ * Mostly used for alternate displays, limit the information shown
+ */
+ public void setOnlyClock(boolean onlyClock) {
+ mOnlyClock = onlyClock;
+ }
+
+ /**
* Attach the controller to the view it relates to.
*/
@Override
@@ -166,6 +175,16 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
}
mColorExtractor.addOnColorsChangedListener(mColorsListener);
mView.updateColors(getGradientColors());
+
+ if (mOnlyClock) {
+ View ksa = mView.findViewById(R.id.keyguard_status_area);
+ ksa.setVisibility(View.GONE);
+
+ View nic = mView.findViewById(
+ R.id.left_aligned_notification_icon_container);
+ nic.setVisibility(View.GONE);
+ return;
+ }
updateAodIcons();
if (mSmartspaceController.isEnabled()) {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
index 76a7473e25e8..cac90ea60e97 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
@@ -332,6 +332,7 @@ public class KeyguardDisplayManager {
.build(findViewById(R.id.clock))
.getKeyguardClockSwitchController();
+ mKeyguardClockSwitchController.setOnlyClock(true);
mKeyguardClockSwitchController.init();
}