Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 357f1543 authored by Steve Elliott's avatar Steve Elliott
Browse files

Re-add notification history tunable

This reverts commit 58ff6d6a.

Change-Id: Ie49f8e3140966211aeba7c230af98570d0ad2375
parent 3663b34d
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -3355,8 +3355,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);
+10 −5
Original line number Diff line number Diff line
@@ -95,11 +95,16 @@ public class NotificationStackScrollLayoutController {
        mNotificationRoundnessManager.setOnRoundingChangedCallback(mView::invalidate);
        mView.addOnExpandedHeightChangedListener(mNotificationRoundnessManager::setExpanded);

        mTunerService.addTunable((key, newValue) -> {
        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();
                    }
        }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL);
                },
                Settings.Secure.NOTIFICATION_DISMISS_RTL,
                Settings.Secure.NOTIFICATION_HISTORY_ENABLED);
    }

    public void addOnExpandedHeightChangedListener(BiConsumer<Float, Float> listener) {