RemoteInputCoordinator to update notif on reply
Modifies RemoteInputCoordinator to always update the notification on direct reply. Before, we'd check "isSpinning" to see if the update came while the notification was in the sending state, which would mean a reply occured for the first time and should be appended. If an update occured and the notification wasn't "spinning," it was a duplicate update caused by the app repeatedly canceling. The problem with this approach is that NotificationContentView _also_ updates the notification, as part of onNotificationUpdated calls applyRemoteInputAndSmartReply, which resets isSpinning. Thus, we have a race condition, where if the update is processed by NotificationContentView before RemoteInputCoordinator, the direct reply never gets appended to the notification. After ag/28913159, we no longer send a special system update beyond the first cancelation of a lifetime extended notification by the app. So, repeated cancelations don't send multiple updates, which means we no longer need to check isSpinning to know if we should update the notification; we should always update. Bug: 360090006 Test: atest NotificationManagerServiceTest, atest RemoteInputCoordinatorTest, atest NotificationRemoteInput Flag: android.app.lifetime_extension_refactor Change-Id: I993cd9fae05f131852d313ba4e5662cbffd49ff6
Loading
Please register or sign in to comment