DO NOT MERGE: Associate notif cancels with notif posts
CancelNotificationRunnables just spin on the work handler of NotificationManagerService, hoping that they get executed at the correct moment after a PostNotificationRunnable and before the next EnqueueNotificationRunnable completes. Otherwise, you end up in a bad state where the cancel either is canceling notifications before they get a chance to post, or missing its only chance to cancel the notification (for instance, ActivityManagerService is the only caller that can cancel FGS notifications). This change attempts to execute a CancelNotificationRunnable at the moment its run() method is called, otherwise it associates the runnable with the latest enqueued notificaiton record which has yet to post. It then associates PostNotificationRunnable with the delayed cancel list, executing any missed cancel operations immediately upon finishing the PostNotificationRunnable. Test: atest SystemUITests NotificationManagerServiceTest; manual Bug: 162652224 Bug: 119041698 Change-Id: I88d3c5f4fd910a83974c2f84ae3e8a9498d18133
Loading
Please register or sign in to comment