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

Commit 33d18eae authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[HUNs] skip cancelling huns when guts are exposed

HeadsUpManager cancels auto removal callback when guts are exposed for HUNs to keep them pinned. However NSSLController remove HUNs  for all non dismissable notifications onChildSnappedback.
This HUN dismissal behavior does not match with the expected behavior by HeadsUpManager. This CL skips immediate HUN removal when GUTs are exposed.

Bug: 372227464
Flag: com.android.systemui.skip_hide_sensitive_notif_animation
Test: Presubmit && see after video.
Change-Id: Ie0ed6d03c9d645ca5606c70312a36c20318193b5
parent 22ff3d80
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) {