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

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

Merge changes I4b7b16c7,Ic591268b into main

* changes:
  Remove debug toggle for bitmap expiration time
  Delete flag: expireBitmaps
parents a4bec890 9bcfc69a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -84,10 +84,6 @@ public class SystemUiSystemPropertiesFlags {
        /** Value used by polite notif. feature */
        public static final Flag NOTIF_AVALANCHE_TIMEOUT = devFlag(
                "persist.debug.sysui.notification.notif_avalanche_timeout", 120_000);

        /** b/303716154: For debugging only: use short bitmap duration. */
        public static final Flag DEBUG_SHORT_BITMAP_DURATION = devFlag(
                "persist.sysui.notification.debug_short_bitmap_duration");
    }

    //// == End of flags.  Everything below this line is the implementation. == ////
+2 −22
Original line number Diff line number Diff line
@@ -187,7 +187,6 @@ 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.bitmapoffload.BitmapOffload.BITMAP_SOURCE_NOTIFICATIONS;
import static com.android.server.notification.Flags.expireBitmaps;
import static com.android.server.notification.Flags.managedServicesConcurrentMultiuser;
import static com.android.server.notification.NotificationManagerService.NotificationPostEvent.NOTIFICATION_POSTED_CACHED;
import static com.android.server.policy.PhoneWindowManager.TOAST_WINDOW_ANIM_BUFFER;
@@ -3539,20 +3538,9 @@ public class NotificationManagerService extends SystemService {
            mPreferencesHelper.updateFixedImportance(mUm.getUsers());
            mPreferencesHelper.migrateNotificationPermissions(mUm.getUsers());
        } else if (phase == SystemService.PHASE_BOOT_COMPLETED) {
            if (mFlagResolver.isEnabled(NotificationFlags.DEBUG_SHORT_BITMAP_DURATION)) {
                new Thread(() -> {
                    while (true) {
                        try {
                            Thread.sleep(5000);
                        } catch (InterruptedException e) { }
                        mInternalService.removeBitmaps();
                    }
                }).start();
            } else if (expireBitmaps()) {
            NotificationBitmapJobService.scheduleJob(getContext());
        }
    }
    }
    @Override
    public void onUserUnlocked(@NonNull TargetUser user) {
@@ -8548,15 +8536,7 @@ public class NotificationManagerService extends SystemService {
                    // System#currentTimeMillis when posted
                    final long timePostedMs = r.getSbn().getPostTime();
                    final long timeNowMs = System.currentTimeMillis();
                    final long bitmapDuration;
                    if (mFlagResolver.isEnabled(NotificationFlags.DEBUG_SHORT_BITMAP_DURATION)) {
                        bitmapDuration = Duration.ofSeconds(5).toMillis();
                    } else {
                        bitmapDuration = BITMAP_DURATION.toMillis();
                    }
                    if (isBitmapExpired(timePostedMs, timeNowMs, bitmapDuration)) {
                    if (isBitmapExpired(timePostedMs, timeNowMs, BITMAP_DURATION.toMillis())) {
                        removeBitmapAndRepost(r);
                    }
                }