Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifInflaterImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ public class NotifInflaterImpl implements NotifInflater { entry.abortTask(); } @Override public void releaseViews(@NonNull NotificationEntry entry) { requireBinder().releaseViews(entry); } private NotificationContentInflater.InflationCallback wrapInflationCallback( InflationCallback callback) { return new NotificationContentInflater.InflationCallback() { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java +1 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,7 @@ public class PreparationCoordinator implements Coordinator { private void freeNotifViews(NotificationEntry entry) { mViewBarn.removeViewForEntry(entry); mNotifInflater.releaseViews(entry); // TODO: clear the entry's row here, or even better, stop setting the row on the entry! mInflationStates.put(entry, STATE_UNINFLATED); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotifInflater.kt +5 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,11 @@ interface NotifInflater { */ fun abortInflation(entry: NotificationEntry) /** * Called to let the system remove the content views from the notification row. */ fun releaseViews(entry: NotificationEntry) /** * Callback once all the views are inflated and bound for a given NotificationEntry. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinder.java +5 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,9 @@ public interface NotificationRowBinder { NotificationUiAdjustment oldAdjustment, NotificationUiAdjustment newAdjustment, NotificationRowContentBinder.InflationCallback callback); /** * Called when a notification is no longer likely to be displayed and can have its views freed. */ void releaseViews(NotificationEntry entry); } packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +16 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.collection.inflation; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC; import static java.util.Objects.requireNonNull; Loading Loading @@ -161,6 +163,18 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } } @Override public void releaseViews(NotificationEntry entry) { if (!entry.rowExists()) { return; } final RowContentBindParams params = mRowContentBindStage.getStageParams(entry); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_CONTRACTED); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_EXPANDED); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC); mRowContentBindStage.requestRebind(entry, null); } /** * Bind row to various controllers and managers. This is only called when the row is first * created. Loading Loading @@ -249,6 +263,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } RowContentBindParams params = mRowContentBindStage.getStageParams(entry); params.requireContentViews(FLAG_CONTENT_VIEW_CONTRACTED); params.requireContentViews(FLAG_CONTENT_VIEW_EXPANDED); params.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); params.setUseLowPriority(isLowPriority); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifInflaterImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ public class NotifInflaterImpl implements NotifInflater { entry.abortTask(); } @Override public void releaseViews(@NonNull NotificationEntry entry) { requireBinder().releaseViews(entry); } private NotificationContentInflater.InflationCallback wrapInflationCallback( InflationCallback callback) { return new NotificationContentInflater.InflationCallback() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java +1 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,7 @@ public class PreparationCoordinator implements Coordinator { private void freeNotifViews(NotificationEntry entry) { mViewBarn.removeViewForEntry(entry); mNotifInflater.releaseViews(entry); // TODO: clear the entry's row here, or even better, stop setting the row on the entry! mInflationStates.put(entry, STATE_UNINFLATED); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotifInflater.kt +5 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,11 @@ interface NotifInflater { */ fun abortInflation(entry: NotificationEntry) /** * Called to let the system remove the content views from the notification row. */ fun releaseViews(entry: NotificationEntry) /** * Callback once all the views are inflated and bound for a given NotificationEntry. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinder.java +5 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,9 @@ public interface NotificationRowBinder { NotificationUiAdjustment oldAdjustment, NotificationUiAdjustment newAdjustment, NotificationRowContentBinder.InflationCallback callback); /** * Called when a notification is no longer likely to be displayed and can have its views freed. */ void releaseViews(NotificationEntry entry); }
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +16 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.collection.inflation; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC; import static java.util.Objects.requireNonNull; Loading Loading @@ -161,6 +163,18 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } } @Override public void releaseViews(NotificationEntry entry) { if (!entry.rowExists()) { return; } final RowContentBindParams params = mRowContentBindStage.getStageParams(entry); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_CONTRACTED); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_EXPANDED); params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC); mRowContentBindStage.requestRebind(entry, null); } /** * Bind row to various controllers and managers. This is only called when the row is first * created. Loading Loading @@ -249,6 +263,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } RowContentBindParams params = mRowContentBindStage.getStageParams(entry); params.requireContentViews(FLAG_CONTENT_VIEW_CONTRACTED); params.requireContentViews(FLAG_CONTENT_VIEW_EXPANDED); params.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); params.setUseLowPriority(isLowPriority); Loading