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

Commit 3b410191 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Use Duration instead of primitive for expiration time" into main

parents 9b0dadd1 6cf75e9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ public class NotificationManagerService extends SystemService {
    static final int MESSAGE_FINISH_TOKEN_TIMEOUT = 7;
    static final int MESSAGE_ON_PACKAGE_CHANGED = 8;
    static final long BITMAP_EXPIRATION_TIME_MS = TimeUnit.HOURS.toMillis(24);
    static final Duration BITMAP_DURATION = Duration.ofHours(24);
    // ranking thread messages
    private static final int MESSAGE_RECONSIDER_RANKING = 1000;
@@ -6705,7 +6705,7 @@ public class NotificationManagerService extends SystemService {
                    final long timePostedMs = r.getSbn().getPostTime();
                    final long timeNowMs = System.currentTimeMillis();
                    if (isBitmapExpired(timePostedMs, timeNowMs, BITMAP_EXPIRATION_TIME_MS)) {
                    if (isBitmapExpired(timePostedMs, timeNowMs, BITMAP_DURATION.toMillis())) {
                        removeBitmapAndRepost(r);
                    }
                }
+2 −2
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR
import static com.android.server.am.PendingIntentRecord.FLAG_ACTIVITY_SENDER;
import static com.android.server.am.PendingIntentRecord.FLAG_BROADCAST_SENDER;
import static com.android.server.am.PendingIntentRecord.FLAG_SERVICE_SENDER;
import static com.android.server.notification.NotificationManagerService.BITMAP_EXPIRATION_TIME_MS;
import static com.android.server.notification.NotificationManagerService.BITMAP_DURATION;
import static com.android.server.notification.NotificationManagerService.DEFAULT_MAX_NOTIFICATION_ENQUEUE_RATE;
import static com.android.server.notification.NotificationRecordLogger.NotificationReportedEvent.NOTIFICATION_ADJUSTED;
import static com.android.server.notification.NotificationRecordLogger.NotificationReportedEvent.NOTIFICATION_POSTED;
@@ -11381,7 +11381,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        long timePostedMs = System.currentTimeMillis();
        if (isExpired) {
            timePostedMs -= BITMAP_EXPIRATION_TIME_MS;
            timePostedMs -= BITMAP_DURATION.toMillis();
        }
        StatusBarNotification sbn = new StatusBarNotification(PKG, PKG, 8, "tag", mUid, 0,
                notification, UserHandle.getUserHandleForUid(mUid), null, timePostedMs);