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

Commit 8b5560c9 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "Update NotificationEntry.isRowPinned through the HeadsUpEntry" into main

parents 2c9963ca af0bfcf9
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -304,14 +304,15 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
        if (!isPinned) {
        if (!isPinned) {
            headsUpEntry.mWasUnpinned = true;
            headsUpEntry.mWasUnpinned = true;
        }
        }
        if (entry.isRowPinned() != isPinned) {
        if (headsUpEntry.isPinned() != isPinned) {
            entry.setRowPinned(isPinned);
            headsUpEntry.setPinned(isPinned);
            updatePinnedMode();
            updatePinnedMode();
            if (isPinned && entry.getSbn() != null) {
            if (isPinned && entry.getSbn() != null) {
               mUiEventLogger.logWithInstanceId(
               mUiEventLogger.logWithInstanceId(
                        NotificationPeekEvent.NOTIFICATION_PEEK, entry.getSbn().getUid(),
                        NotificationPeekEvent.NOTIFICATION_PEEK, entry.getSbn().getUid(),
                        entry.getSbn().getPackageName(), entry.getSbn().getInstanceId());
                        entry.getSbn().getPackageName(), entry.getSbn().getInstanceId());
            }
            }
            // TODO(b/325936094) convert these listeners to collecting a flow
            for (OnHeadsUpChangedListener listener : mListeners) {
            for (OnHeadsUpChangedListener listener : mListeners) {
                if (isPinned) {
                if (isPinned) {
                    listener.onHeadsUpPinned(entry);
                    listener.onHeadsUpPinned(entry);
@@ -662,6 +663,14 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
            updateEntry(true /* updatePostTime */, "setEntry");
            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.
         * Updates an entry's removal time.
         * @param updatePostTime whether or not to refresh the post time
         * @param updatePostTime whether or not to refresh the post time