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

Commit 639a139e authored by Jay Aliomer's avatar Jay Aliomer
Browse files

Remane shouldExtendLifetime to meaningful maybeExtendLifetime

Test: all pipeline test
Change-Id: If24a2c0bc5b5ab3c26e32dbef4f7c3b6cd618dab
parent ca5641d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -622,7 +622,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