Fix Notification inflation on secondary displays
RemoteViews from notifications are inflated using an application context (see NotificationRowContentBinderImpl#doInBackgroundInternal). On the notification side, StatusBarNotification.getPackageContext caches the context until StatusBarNotification.clearPackageContext is called. While this is reasonable in the case of a single display, it breaks notifications moving across displays, as if the first call was done with the default display (e.g. from StatusbarIconView.getIcon), and the second from the shade (e.g. NotificationRowContentBinderImpl#doInBackgroundInternal), this would result in notifications being inflated with the first cached context (which is wrong, as it might have the wrong density). In StatusBarNotification we will have a per display id cache of application context. Everything new is under the flag. Bug: 362719719 Bug: 388886443 Test: StatusBarNotificationTest Flag: com.android.window.flags.enable_per_display_package_context_cache_in_statusbar_notif Change-Id: Ife87ad95bb6cf4199b06d5a58a5fb4713e44b835
Loading
Please register or sign in to comment