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

Commit 32b51436 authored by Joe Onorato's avatar Joe Onorato
Browse files

Fix 2495749 - System process crash when a notification switches sections.

Change-Id: I86ff1b78fc309b758c6457be867509b71042d42e
parent 661a1976
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -173,6 +173,12 @@ class NotificationViewList {
    }

    void add(StatusBarNotification notification) {
        if (StatusBarService.SPEW) {
            Slog.d(StatusBarService.TAG, "before add NotificationViewList"
                    + " notification.data.ongoingEvent=" + notification.data.ongoingEvent);
            dump(notification);
        }

        ArrayList<StatusBarNotification> list = notification.data.ongoingEvent ? mOngoing : mLatest;
        long when = notification.data.when;
        final int N = list.size();
@@ -187,20 +193,25 @@ class NotificationViewList {
        list.add(index, notification);

        if (StatusBarService.SPEW) {
            Slog.d(StatusBarService.TAG, "NotificationViewList index=" + index);
            Slog.d(StatusBarService.TAG, "after add NotificationViewList index=" + index);
            dump(notification);
        }
    }

    void dump(StatusBarNotification notification) {
        if (StatusBarService.SPEW) {
            boolean showTime = false;
            String s = "";
            for (int i=0; i<mOngoing.size(); i++) {
                StatusBarNotification that = mOngoing.get(i);
                if (that.key == notification.key) {
                    s += "[";
                }
                if (showTime) {
                    s += that.data.when;
                } else {
                    s += that.data.pkg + "/" + that.data.id + "/" + that.view;
                }
                if (that.key == notification.key) {
                    s += "]";
                }
@@ -214,7 +225,11 @@ class NotificationViewList {
                if (that.key == notification.key) {
                    s += "[";
                }
                if (showTime) {
                    s += that.data.when;
                } else {
                    s += that.data.pkg + "/" + that.data.id + "/" + that.view;
                }
                if (that.key == notification.key) {
                    s += "]";
                }
+2 −0
Original line number Diff line number Diff line
@@ -893,6 +893,8 @@ public class StatusBarService extends IStatusBar.Stub
    void updateNotificationView(StatusBarNotification notification, NotificationData oldData) {
        NotificationData n = notification.data;
        if (oldData != null && n != null
                && n.when == oldData.when
                && n.ongoingEvent == oldData.ongoingEvent
                && n.contentView != null && oldData.contentView != null
                && n.contentView.getPackage() != null
                && oldData.contentView.getPackage() != null