Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86928bb1 authored by Gus Prevas's avatar Gus Prevas
Browse files

Moves icon management to NotificationRowBinder.

This change moves the calls in NotificationEntryManager to
NotificationData.Entry.createIcons() and .removeIcons() to
NotificationRowBinder.inflateViews() to encapsulate all the view
handling in the latter class (and so that we can eventually not create
those icon views right away).

Test: atest SystemUITests, manually
Change-Id: Ie515c85b81ce6ad5de607b83e8f242d7ae03326e
parent 22b99b47
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -443,7 +443,6 @@ public class NotificationEntryManager implements
        }

        Dependency.get(LeakDetector.class).trackInstance(entry);
        entry.createIcons(mContext, sbn);
        // Construct the expanded view.
        getRowBinder().inflateViews(entry, () -> performRemoveNotification(sbn),
                mNotificationData.get(entry.key) != null);
@@ -523,7 +522,6 @@ public class NotificationEntryManager implements

        mNotificationData.update(entry, ranking, notification);

        entry.updateIcons(mContext, notification);
        getRowBinder().inflateViews(entry, () -> performRemoveNotification(notification),
                mNotificationData.get(entry.key) != null);

+7 −2
Original line number Diff line number Diff line
@@ -120,17 +120,22 @@ public class NotificationRowBinder {
    /**
     * Inflates the views for the given entry (possibly asynchronously).
     */
    public void inflateViews(NotificationData.Entry entry, Runnable onDismissRunnable,
            boolean isUpdate) {
    public void inflateViews(
            NotificationData.Entry entry,
            Runnable onDismissRunnable,
            boolean isUpdate)
            throws InflationException {
        ViewGroup parent = mListContainer.getViewParentForNotification(entry);
        PackageManager pmUser = StatusBar.getPackageManagerForUser(mContext,
                entry.notification.getUser().getIdentifier());

        final StatusBarNotification sbn = entry.notification;
        if (entry.rowExists()) {
            entry.updateIcons(mContext, sbn);
            entry.reset();
            updateNotification(entry, pmUser, sbn, entry.getRow(), isUpdate);
        } else {
            entry.createIcons(mContext, sbn);
            new RowInflaterTask().inflate(mContext, parent, entry,
                    row -> {
                        bindRow(entry, pmUser, sbn, row, onDismissRunnable);