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

Commit 420372af authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "[HUNs] skip cancelling huns when guts are exposed" into main

parents 4250e679 33d18eae
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2179,3 +2179,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
   name: "skip_cancelling_huns_for_guts"
   namespace: "systemui"
   description: "Do not cancel HUNs when GUTs are exposed"
   bug: "372227464"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}
 No newline at end of file
+16 −5
Original line number Diff line number Diff line
@@ -668,11 +668,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                public void onChildSnappedBack(View animView, float targetLeft) {
                    mView.onSwipeEnd();
                    if (animView instanceof ExpandableNotificationRow row) {
                        boolean cannotFullScreen = NotificationBundleUi.isEnabled()
                                ? !row.getEntryAdapter().isFullScreenCapable()
                                : (row.getEntryLegacy().getSbn().getNotification().fullScreenIntent
                                        == null);
                        if (row.isPinned() && !canChildBeDismissed(row) && cannotFullScreen) {
                        if (canHeadsUpBeCancelled(row)) {
                            mHeadsUpManager.removeNotification(
                                    row.getKey(),
                                    /* removeImmediately= */ true,
@@ -682,6 +678,21 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                    }
                }

                private boolean canHeadsUpBeCancelled(ExpandableNotificationRow row) {
                    final boolean areGutsNotExposed =
                            !Flags.skipCancellingHunsForGuts() || !row.areGutsExposed();

                    final boolean cannotFullScreen = NotificationBundleUi.isEnabled()
                            ? !row.getEntryAdapter().isFullScreenCapable()
                            : (row.getEntryLegacy().getSbn().getNotification().fullScreenIntent
                                    == null);

                    return row.isPinned()
                            && !canChildBeDismissed(row)
                            && cannotFullScreen
                            && areGutsNotExposed;
                }

                @Override
                public boolean updateSwipeProgress(View animView, boolean dismissable,
                        float swipeProgress) {