Don't crash if we're given an incomplete ranking
Right now there's a race condition in NotificationListener that means
that we can (briefly) be exposed to rankings that don't contain all of
the notifications that we know about. The order is as follows:
(system server)
queue onListenerConnected
queue onNotificationPosted
queue onNotificationPosted
(sysui offthread)
see onListenerConnected
read list of current notifs (2 total)
post to main.onListenerConnected
see onNotificationPosted, post to main.onNotifPosted
see onNotificationPosted, post to main.onNotifPosted
(sysui main thread)
see main.onListenerConnected, add notifs #1 and #2
see main.onNotificationPosted, attempt to re-add notif#1 (counts as
update, fine), attempt to update ranking (ERROR, missing ranking for
notif#2, crash)
Filed b/148791039 to track the overall race condition.
Short-term fix is to just disable this check and be sad.
Fixes: 148291993
Test: atest
Change-Id: Id03dccfed3f2c061b7603b7e9e3b5210aeaaf962
1 file changed