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

Commit eeed9949 authored by Joe Onorato's avatar Joe Onorato
Browse files

Don't re-show the ticker for a notification if they have set FLAG_ONLY_SHOW_ONCE.

Bug: 3306725
Change-Id: Ie733ad38d9e801f676966fa3ddee6847670c6deb
parent 281d83f6
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ public class TabletStatusBar extends StatusBar {
            } catch (PendingIntent.CanceledException e) {
            }
        } else {
            tick(key, notification);
            tick(key, notification, true);
        }

        setAreThereNotifications();
@@ -628,7 +628,7 @@ public class TabletStatusBar extends StatusBar {
        if (false && immersive) {
            // TODO: immersive mode
        } else {
            tick(key, notification);
            tick(key, notification, false);
        }

        setAreThereNotifications();
@@ -707,11 +707,16 @@ public class TabletStatusBar extends StatusBar {
        return n.tickerView != null || !TextUtils.isEmpty(n.tickerText);
    }

    private void tick(IBinder key, StatusBarNotification n) {
    private void tick(IBinder key, StatusBarNotification n, boolean firstTime) {
        // Don't show the ticker when the windowshade is open.
        if (mNotificationPanel.isShowing()) {
            return;
        }
        // If they asked for FLAG_ONLY_ALERT_ONCE, then only show this notification
        // if it's a new notification.
        if (!firstTime && (n.notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0) {
            return;
        }
        // Show the ticker if one is requested. Also don't do this
        // until status bar window is attached to the window manager,
        // because...  well, what's the point otherwise?  And trying to