Merge "Re-add notification history tunable"

This commit is contained in:
TreeHugger Robot
2020-08-17 19:15:48 +00:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 10 deletions

View File

@@ -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<Listener> mListeners = new ArraySet<>();
private final ArraySet<Listener> 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;

View File

@@ -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);

View File

@@ -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<Float, Float> listener) {