diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java index 19637bbd54df3..9482c17a87693 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification; +import android.annotation.Nullable; import android.util.ArraySet; import com.android.systemui.dagger.SysUISingleton; @@ -36,11 +37,11 @@ public class DynamicPrivacyController implements KeyguardStateController.Callbac private final KeyguardStateController mKeyguardStateController; private final NotificationLockscreenUserManager mLockscreenUserManager; private final StatusBarStateController mStateController; - private ArraySet mListeners = new ArraySet<>(); + private final ArraySet mListeners = new ArraySet<>(); private boolean mLastDynamicUnlocked; private boolean mCacheInvalid; - private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; + @Nullable private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Inject DynamicPrivacyController(NotificationLockscreenUserManager notificationLockscreenUserManager, @@ -96,8 +97,7 @@ public class DynamicPrivacyController implements KeyguardStateController.Callbac * contents aren't revealed yet? */ public boolean isInLockedDownShade() { - if (!mStatusBarKeyguardViewManager.isShowing() - || !mKeyguardStateController.isMethodSecure()) { + if (!isStatusBarKeyguardShowing() || !mKeyguardStateController.isMethodSecure()) { return false; } int state = mStateController.getState(); @@ -110,6 +110,10 @@ public class DynamicPrivacyController implements KeyguardStateController.Callbac return true; } + private boolean isStatusBarKeyguardShowing() { + return mStatusBarKeyguardViewManager != null && mStatusBarKeyguardViewManager.isShowing(); + } + public void setStatusBarKeyguardViewManager( StatusBarKeyguardViewManager statusBarKeyguardViewManager) { mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 7ecc036fa1944..2eb472b2f3a2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -3353,8 +3353,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @ShadeViewRefactor(RefactorComponent.COORDINATOR) void onViewAddedInternal(ExpandableView child) { - child.setOnHeightChangedListener(mOnChildHeightChangedListener); updateHideSensitiveForChild(child); + child.setOnHeightChangedListener(mOnChildHeightChangedListener); generateAddAnimation(child, false /* fromMoreCard */); updateAnimationState(child); updateChronometerForChild(child); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 247f2cad2fe86..d52b3038f93da 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -94,11 +94,16 @@ public class NotificationStackScrollLayoutController { mNotificationRoundnessManager.setOnRoundingChangedCallback(mView::invalidate); mView.addOnExpandedHeightChangedListener(mNotificationRoundnessManager::setExpanded); - mTunerService.addTunable((key, newValue) -> { - if (key.equals(Settings.Secure.NOTIFICATION_DISMISS_RTL)) { - mView.updateDismissRtlSetting("1".equals(newValue)); - } - }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL); + mTunerService.addTunable( + (key, newValue) -> { + if (key.equals(Settings.Secure.NOTIFICATION_DISMISS_RTL)) { + mView.updateDismissRtlSetting("1".equals(newValue)); + } else if (key.equals(Settings.Secure.NOTIFICATION_HISTORY_ENABLED)) { + updateFooter(); + } + }, + Settings.Secure.NOTIFICATION_DISMISS_RTL, + Settings.Secure.NOTIFICATION_HISTORY_ENABLED); } public void addOnExpandedHeightChangedListener(BiConsumer listener) {