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

Commit c4da1356 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[Inline Reply] Dismiss pinned and expanded hun

This CL dismisses pinned and expanded huns when their inline reply is actived at least once.

Bug: 346976443
Test: Post a HUN and reply HUN. Observe this HUN is dismissed after sometime. Post a HUN and activate inline reply. Cancel inline repy by closing keyboard and tapping outside of Notification. Observe this HUN is dismissed after sometime.
Flag: com.android.systemui.expand_heads_up_on_inline_reply
Change-Id: Iea6ccf8e2b2223f9e5beae9279e7138fb262a12b
parent 800e1d63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -300,6 +300,9 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements
        HeadsUpEntryPhone headsUpEntry = getHeadsUpEntryPhone(entry.getKey());
        if (headsUpEntry != null && headsUpEntry.mRemoteInputActive != remoteInputActive) {
            headsUpEntry.mRemoteInputActive = remoteInputActive;
            if (ExpandHeadsUpOnInlineReply.isEnabled() && remoteInputActive) {
                headsUpEntry.mRemoteInputActivatedAtLeastOnce = true;
            }
            if (remoteInputActive) {
                headsUpEntry.cancelAutoRemovalCallbacks("setRemoteInputActive(true)");
            } else {
+11 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag;
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun;
import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor;
import com.android.systemui.statusbar.phone.ExpandHeadsUpOnInlineReply;
import com.android.systemui.util.ListenerSet;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.settings.GlobalSettings;
@@ -726,6 +727,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
     * of AvalancheController that take it as param.
     */
    public class HeadsUpEntry implements Comparable<HeadsUpEntry> {
        public boolean mRemoteInputActivatedAtLeastOnce;
        public boolean mRemoteInputActive;
        public boolean mUserActionMayIndirectlyRemove;

@@ -835,6 +837,15 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
         */
        public boolean isSticky() {
            if (mEntry == null) return false;

            if (ExpandHeadsUpOnInlineReply.isEnabled()) {
                // we don't consider pinned and expanded huns as sticky after the remote input
                // has been activated for them
                if (!mRemoteInputActive && mRemoteInputActivatedAtLeastOnce) {
                    return false;
                }
            }

            return (mEntry.isRowPinned() && mExpanded)
                    || mRemoteInputActive
                    || hasFullScreenIntent(mEntry);