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

Commit cba18934 authored by Tony Wickham's avatar Tony Wickham
Browse files

Ensure notification listener is connected before getting notifications

There was a potential race condition where we would try to do a full
refresh of notifications before the listener was connected. Now we
skip the full refresh if we aren't connected, which is fine because
we also do a full refresh in onListenerConnected() anyway.

Bug: 62107069
Change-Id: I2fe4f49eb8a840230d32034be11fe7765a366e75
parent 59fbea39
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -127,8 +127,9 @@ public class NotificationListener extends NotificationListenerService {
        }
        sNotificationsChangedListener = listener;

        if (sNotificationListenerInstance != null) {
            sNotificationListenerInstance.onNotificationFullRefresh();
        NotificationListener notificationListener = getInstanceIfConnected();
        if (notificationListener != null) {
            notificationListener.onNotificationFullRefresh();
        }
    }