Allow NotificationAssistantService to suggest smart actions
Here is the flow: NAS generates Adjustment -> NMS convert this to RankingUpdate -> SystemUI.NotificationListener receives the RankingUpdate in either onNotificationPosted / onNotificationRankingUpdate (Depend on does NAS provides the adjustment before the notification is en-queued) -> NotificationEntryManager determines the need of reinflation -> NotificationInflater inflates / reinflates the view with these extra bits like smart actions. Note: We do re-inflation here as simply adding a button to the existing notification view seems problematic. For example, if the original notification does not have any action, we will need to inflate the template with the action container. Screenshot: https://hsv.googleplex.com/5731489463402496 Test: atest SystemUITests Test: atest com.android.server.notification.NotificationAdjustmentExtractorTest Test: Modify ExtServices to provide adjustment in createEnqueuedNotificationAdjustment, post a notification with a entity in a sample app, observed the notification is updated. (Testing the onNotificationPosted flow) Test: Modify ExtServices to provide adjustment in onNotificationPosted by calling adjustNotification. Post a notification with a entity in a sample app, observed the notification is updated. (Testing the onRankingUpdated flow) Test: Repeat the above test, but explicitly make the RowInflaterTask slow by inserting Thread.sleep. This can test the onRankingUpdated flow when the row is not yet inflated. BUG: 110527159 Change-Id: I98aee3ac62f60b189ea92ac9fc000127325dfead
Loading
Please register or sign in to comment