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

Commit 31aa239b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename setShouldExtendLifetime in LifetimeExtender"

parents a1a74cb4 e9e938c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public abstract class AlertingNotificationManager implements NotificationLifetim
    }

    @Override
    public void setShouldExtendLifetime(NotificationData.Entry entry, boolean shouldExtend) {
    public void setShouldManageLifetime(NotificationData.Entry entry, boolean shouldExtend) {
        if (shouldExtend) {
            mExtendedLifetimeAlertEntries.add(entry);
        } else {
+7 −7
Original line number Diff line number Diff line
@@ -27,17 +27,17 @@ public interface NotificationLifetimeExtender {
    boolean shouldExtendLifetime(@NonNull NotificationData.Entry entry);

    /**
     * Sets whether or not the lifetime should be extended.  In practice, if shouldExtend is
     * true, this is where the extender starts managing the entry internally and is now
     * responsible for calling {@link NotificationSafeToRemoveCallback#onSafeToRemove(String)} when
     * the entry is safe to remove.  If shouldExtend is false, the extender no longer needs to
     * Sets whether or not the lifetime should be managed by the extender.  In practice, if
     * shouldManage is true, this is where the extender starts managing the entry internally and is
     * now responsible for calling {@link NotificationSafeToRemoveCallback#onSafeToRemove(String)}
     * when the entry is safe to remove.  If shouldManage is false, the extender no longer needs to
     * worry about it (either because we will be removing it anyway or the entry is no longer
     * removed due to an update).
     *
     * @param entry the entry to mark as having an extended lifetime
     * @param shouldExtend true if the extender should manage the entry now, false otherwise
     * @param entry the entry that needs an extended lifetime
     * @param shouldManage true if the extender should manage the entry now, false otherwise
     */
    void setShouldExtendLifetime(@NonNull NotificationData.Entry entry, boolean shouldExtend);
    void setShouldManageLifetime(@NonNull NotificationData.Entry entry, boolean shouldManage);

    /**
     * The callback for when the notification is now safe to remove (i.e. its lifetime has ended).
+3 −3
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ public class NotificationRemoteInputManager implements Dumpable {
        }

        @Override
        public void setShouldExtendLifetime(NotificationData.Entry entry,
        public void setShouldManageLifetime(NotificationData.Entry entry,
                boolean shouldExtend) {
            if (shouldExtend) {
                CharSequence remoteInputText = entry.remoteInputText;
@@ -548,7 +548,7 @@ public class NotificationRemoteInputManager implements Dumpable {
        }

        @Override
        public void setShouldExtendLifetime(NotificationData.Entry entry,
        public void setShouldManageLifetime(NotificationData.Entry entry,
                boolean shouldExtend) {
            if (shouldExtend) {
                StatusBarNotification newSbn = rebuildNotificationForCanceledSmartReplies(entry);
@@ -589,7 +589,7 @@ public class NotificationRemoteInputManager implements Dumpable {
        }

        @Override
        public void setShouldExtendLifetime(NotificationData.Entry entry,
        public void setShouldManageLifetime(NotificationData.Entry entry,
                boolean shouldExtend) {
            if (shouldExtend) {
                if (Log.isLoggable(TAG, Log.DEBUG)) {
+4 −4
Original line number Diff line number Diff line
@@ -491,7 +491,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
            for (NotificationLifetimeExtender extender : mNotificationLifetimeExtenders) {
                if (extender.shouldExtendLifetime(entry)) {
                    mLatestRankingMap = ranking;
                    extender.setShouldExtendLifetime(entry, true /* shouldExtend */);
                    extender.setShouldManageLifetime(entry, true /* shouldManage */);
                    return;
                }
            }
@@ -501,7 +501,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.

        // Ensure any managers keeping the lifetime extended stop managing the entry
        for (NotificationLifetimeExtender extender: mNotificationLifetimeExtenders) {
            extender.setShouldExtendLifetime(entry, false /* shouldExtend */);
            extender.setShouldManageLifetime(entry, false /* shouldManage */);
        }

        mMediaManager.onNotificationRemoved(key);
@@ -745,9 +745,9 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
        }

        // Notification is updated so it is essentially re-added and thus alive again.  Don't need
        // to keep it's lifetime extended.
        // to keep its lifetime extended.
        for (NotificationLifetimeExtender extender : mNotificationLifetimeExtenders) {
            extender.setShouldExtendLifetime(entry, false /* shouldExtend */);
            extender.setShouldManageLifetime(entry, false /* shouldManage */);
        }

        Notification n = notification.getNotification();
+1 −1
Original line number Diff line number Diff line
@@ -418,7 +418,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
    }

    @Override
    public void setShouldExtendLifetime(NotificationData.Entry entry, boolean shouldExtend) {
    public void setShouldManageLifetime(NotificationData.Entry entry, boolean shouldExtend) {
        if (shouldExtend) {
            mKeyToRemoveOnGutsClosed = entry.key;
            if (Log.isLoggable(TAG, Log.DEBUG)) {
Loading