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

Commit 40b0a8e0 authored by Jay Aliomer's avatar Jay Aliomer Committed by Android (Google) Code Review
Browse files

Merge "Remane shouldExtendLifetime to meaningful maybeExtendLifetime"

parents 34f56bf7 639a139e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ public class NotifCollection implements Dumpable {
        entry.mLifetimeExtenders.clear();
        mAmDispatchingToOtherCode = true;
        for (NotifLifetimeExtender extender : mLifetimeExtenders) {
            if (extender.shouldExtendLifetime(entry, entry.mCancellationReason)) {
            if (extender.maybeExtendLifetime(entry, entry.mCancellationReason)) {
                mLogger.logLifetimeExtended(entry.getKey(), extender);
                entry.mLifetimeExtenders.add(extender);
            }
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class GutsCoordinator @Inject constructor(
            onEndLifetimeExtensionCallback = callback
        }

        override fun shouldExtendLifetime(entry: NotificationEntry, reason: Int): Boolean {
        override fun maybeExtendLifetime(entry: NotificationEntry, reason: Int): Boolean {
            val isShowingGuts = isCurrentlyShowingGuts(entry)
            if (isShowingGuts) {
                notifsExtendingLifetime.add(entry.key)
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ public class HeadsUpCoordinator implements Coordinator {
        }

        @Override
        public boolean shouldExtendLifetime(@NonNull NotificationEntry entry, int reason) {
        public boolean maybeExtendLifetime(@NonNull NotificationEntry entry, int reason) {
            boolean extend = !mHeadsUpManager.canRemoveImmediately(entry.getKey());
            if (extend) {
                if (isSticky(entry)) {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public interface NotifLifetimeExtender {
     * called on all lifetime extenders even if earlier ones return true (in other words, multiple
     * lifetime extenders can be extending a notification at the same time).
     */
    boolean shouldExtendLifetime(@NonNull NotificationEntry entry, @CancellationReason int reason);
    boolean maybeExtendLifetime(@NonNull NotificationEntry entry, @CancellationReason int reason);

    /**
     * Called by the NotifCollection to inform a lifetime extender that its extension of a notif
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ abstract class SelfTrackingLifetimeExtender(

    final override fun getName(): String = name

    final override fun shouldExtendLifetime(entry: NotificationEntry, reason: Int): Boolean {
    final override fun maybeExtendLifetime(entry: NotificationEntry, reason: Int): Boolean {
        val shouldExtend = queryShouldExtendLifetime(entry)
        if (debug) {
            Log.d(tag, "$name.shouldExtendLifetime(key=${entry.key}, reason=$reason)" +
Loading