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

Commit d61d4953 authored by Nate Myren's avatar Nate Myren Committed by Android (Google) Code Review
Browse files

Merge "Use notification "when", not sbn post time, for redaction" into main

parents c13535e4 a0d831f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {

        Notification notifWithPrivateVisibility = new Notification();
        notifWithPrivateVisibility.visibility = VISIBILITY_PRIVATE;
        notifWithPrivateVisibility.when = System.currentTimeMillis();
        mCurrentUserNotif = new NotificationEntryBuilder()
                .setNotification(notifWithPrivateVisibility)
                .setUser(new UserHandle(mCurrentUser.id))
@@ -260,7 +261,7 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
                .setChannel(channel)
                .setSensitiveContent(true)
                .setVisibilityOverride(VISIBILITY_NO_OVERRIDE).build());
        mSensitiveNotifPostTime = mSensitiveContentNotif.getSbn().getPostTime();
        mSensitiveNotifPostTime = mSensitiveContentNotif.getSbn().getNotification().getWhen();
        when(mNotifCollection.getEntry(mWorkProfileNotif.getKey())).thenReturn(mWorkProfileNotif);
        when(mKeyguardInteractorLazy.get()).thenReturn(mKeyguardInteractor);
        when(mKeyguardInteractor.isKeyguardDismissible())
+1 −2
Original line number Diff line number Diff line
@@ -121,7 +121,6 @@ public class NotificationLockscreenUserManagerImpl implements

    private static final long LOCK_TIME_FOR_SENSITIVE_REDACTION_MS =
            TimeUnit.MINUTES.toMillis(10);

    private final Lazy<NotificationVisibilityProvider> mVisibilityProviderLazy;
    private final Lazy<CommonNotifCollection> mCommonNotifCollectionLazy;
    private final DevicePolicyManager mDevicePolicyManager;
@@ -751,7 +750,7 @@ public class NotificationLockscreenUserManagerImpl implements
        }

        long lastLockedTime = mLastLockTime.get();
        if (ent.getSbn().getPostTime() < lastLockedTime) {
        if (ent.getSbn().getNotification().getWhen() < lastLockedTime) {
            return false;
        }

+1 −0
Original line number Diff line number Diff line
@@ -799,6 +799,7 @@ constructor(
            }
            redacted.setLargeIcon(original.getLargeIcon())
            redacted.setSmallIcon(original.smallIcon)
            redacted.setWhen(original.getWhen())
            return redacted
        }