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

Commit af0bfcf9 authored by András Kurucz's avatar András Kurucz
Browse files

Update NotificationEntry.isRowPinned through the HeadsUpEntry

Bug: 325936094
Test: atest BaseHeadsUpManagerTest
Flag: None
Change-Id: I91df10310d698b776727e281f18ed9f62ff53dab
parent 3128abe0
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -304,14 +304,15 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
        if (!isPinned) {
            headsUpEntry.mWasUnpinned = true;
        }
        if (entry.isRowPinned() != isPinned) {
            entry.setRowPinned(isPinned);
        if (headsUpEntry.isPinned() != isPinned) {
            headsUpEntry.setPinned(isPinned);
            updatePinnedMode();
            if (isPinned && entry.getSbn() != null) {
               mUiEventLogger.logWithInstanceId(
                        NotificationPeekEvent.NOTIFICATION_PEEK, entry.getSbn().getUid(),
                        entry.getSbn().getPackageName(), entry.getSbn().getInstanceId());
            }
            // TODO(b/325936094) convert these listeners to collecting a flow
            for (OnHeadsUpChangedListener listener : mListeners) {
                if (isPinned) {
                    listener.onHeadsUpPinned(entry);
@@ -662,6 +663,14 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
            updateEntry(true /* updatePostTime */, "setEntry");
        }

        public boolean isPinned() {
            return mEntry != null && mEntry.isRowPinned();
        }

        public void setPinned(boolean pinned) {
            if (mEntry != null) mEntry.setRowPinned(pinned);
        }

        /**
         * Updates an entry's removal time.
         * @param updatePostTime whether or not to refresh the post time