From ee5282e637e75f33c4e9cb616524f0e02cdae70a Mon Sep 17 00:00:00 2001 From: Julia Tuttle Date: Wed, 26 Jan 2022 11:23:45 -0500 Subject: New Pipeline: check initial keyguard state The KeyguardCoordinator is responsible for paying attention to the keyguard state and updating the SectionHeaderVisibilityProvider correspondingly. Instead of assuming we boot to the keyguard, and therefore that section headers should be hidden, check the keyguard state and update the header visibility when the coordinator attaches to the pipeline. Bug: 216288085 Test: manual Change-Id: Ic6e032043388070b4a162e57d84b9fe2ed6fbf46 --- .../collection/coordinator/KeyguardCoordinator.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java index 0ce07cb99d52..361f44e0c4b9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java @@ -98,6 +98,8 @@ public class KeyguardCoordinator implements Coordinator { setupInvalidateNotifListCallbacks(); // Filter at the "finalize" stage so that views remain bound by PreparationCoordinator pipeline.addFinalizeFilter(mNotifFilter); + + updateSectionHeadersVisibility(); } private final NotifFilter mNotifFilter = new NotifFilter(TAG) { @@ -220,10 +222,7 @@ public class KeyguardCoordinator implements Coordinator { } private void invalidateListFromFilter(String reason) { - boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD; - boolean neverShowSections = mSectionHeaderVisibilityProvider.getNeverShowSectionHeaders(); - boolean showSections = !onKeyguard && !neverShowSections; - mSectionHeaderVisibilityProvider.setSectionHeadersVisible(showSections); + updateSectionHeadersVisibility(); mNotifFilter.invalidateList(); } @@ -235,6 +234,13 @@ public class KeyguardCoordinator implements Coordinator { 1) == 0; } + private void updateSectionHeadersVisibility() { + boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD; + boolean neverShowSections = mSectionHeaderVisibilityProvider.getNeverShowSectionHeaders(); + boolean showSections = !onKeyguard && !neverShowSections; + mSectionHeaderVisibilityProvider.setSectionHeadersVisible(showSections); + } + private final KeyguardStateController.Callback mKeyguardCallback = new KeyguardStateController.Callback() { @Override -- cgit v1.2.3-59-g8ed1b