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

Commit cd240190 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I1e5ea680,I8366010a

* changes:
  Introduce NotifBindPipeline (2/2)
  Introduce NotifBindPipeline (1/2)
parents 2b3feba7 933dc7cf
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -22,11 +22,4 @@ package com.android.systemui.statusbar;
 */
public interface InflationTask {
    void abort();

    /**
     * Supersedes an existing task. i.e another task was superceeded by this.
     *
     * @param task the task that was previously running
     */
    default void supersedeTask(InflationTask task) {}
}
+6 −8
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag;
import com.android.systemui.statusbar.policy.HeadsUpManager;

import javax.inject.Inject;
@@ -64,8 +63,8 @@ public class NotificationAlertingManager {

        notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
            @Override
            public void onEntryInflated(NotificationEntry entry, int inflatedFlags) {
                showAlertingView(entry, inflatedFlags);
            public void onEntryInflated(NotificationEntry entry) {
                showAlertingView(entry);
            }

            @Override
@@ -90,12 +89,11 @@ public class NotificationAlertingManager {
    /**
     * Adds the entry to the respective alerting manager if the content view was inflated and
     * the entry should still alert.
     *
     * @param entry         entry to add
     * @param inflatedFlags flags representing content views that were inflated
     */
    private void showAlertingView(NotificationEntry entry, @InflationFlag int inflatedFlags) {
        if ((inflatedFlags & FLAG_CONTENT_VIEW_HEADS_UP) != 0) {
    private void showAlertingView(NotificationEntry entry) {
        // TODO: Instead of this back and forth, we should listen to changes in heads up and
        // cancel on-going heads up view inflation using the bind pipeline.
        if (entry.getRow().getPrivateLayout().getHeadsUpChild() != null) {
            // Possible for shouldHeadsUp to change between the inflation starting and ending.
            // If it does and we no longer need to heads up, we should free the view.
            if (mNotificationInterruptionStateProvider.shouldHeadsUp(entry)) {
+1 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import androidx.annotation.NonNull;

import com.android.internal.statusbar.NotificationVisibility;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag;

/**
 * Listener interface for changes sent by NotificationEntryManager.
@@ -62,7 +61,7 @@ public interface NotificationEntryListener {
    /**
     * Called when a notification's views are inflated for the first time.
     */
    default void onEntryInflated(NotificationEntry entry, @InflationFlag int inflatedFlags) {
    default void onEntryInflated(NotificationEntry entry) {
    }

    /**
+2 −4
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import com.android.systemui.statusbar.notification.collection.notifcollection.No
import com.android.systemui.statusbar.notification.logging.NotifEvent;
import com.android.systemui.statusbar.notification.logging.NotifLog;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -323,8 +322,7 @@ public class NotificationEntryManager implements
    }

    @Override
    public void onAsyncInflationFinished(NotificationEntry entry,
            @InflationFlag int inflatedFlags) {
    public void onAsyncInflationFinished(NotificationEntry entry) {
        mPendingNotifications.remove(entry.getKey());
        // If there was an async task started after the removal, we don't want to add it back to
        // the list, otherwise we might get leaks.
@@ -333,7 +331,7 @@ public class NotificationEntryManager implements
            if (isNew) {
                for (NotificationEntryListener listener : mNotificationEntryListeners) {
                    mNotifLog.log(NotifEvent.INFLATED, entry);
                    listener.onEntryInflated(entry, inflatedFlags);
                    listener.onEntryInflated(entry);
                }
                addActiveNotification(entry);
                updateNotifications("onAsyncInflationFinished");
+1 −3
Original line number Diff line number Diff line
@@ -149,9 +149,7 @@ public class NotifInflaterImpl implements NotifInflater {
                }

                @Override
                public void onAsyncInflationFinished(
                        NotificationEntry entry,
                        int inflatedFlags) {
                public void onAsyncInflationFinished(NotificationEntry entry) {
                    if (mExternalInflationCallback != null) {
                        mExternalInflationCallback.onInflationFinished(entry);
                    }
Loading