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
This commit is contained in:
Matt Pietal
2021-08-12 18:26:15 -04:00
parent 66d5c60581
commit 893286a5d4
2 changed files with 20 additions and 0 deletions

View File

@@ -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,
@@ -128,6 +130,13 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mSmartspaceTransitionController = smartspaceTransitionController;
}
/**
* 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.
*/
@@ -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()) {

View File

@@ -332,6 +332,7 @@ public class KeyguardDisplayManager {
.build(findViewById(R.id.clock))
.getKeyguardClockSwitchController();
mKeyguardClockSwitchController.setOnlyClock(true);
mKeyguardClockSwitchController.init();
}