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

Commit ae720053 authored by Kevin Han's avatar Kevin Han Committed by Android (Google) Code Review
Browse files

Merge "Don't throw exception for inflation after removal" into rvc-dev

parents 85c3e4d6 a6190645
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.notification.row;

import android.annotation.MainThread;
import android.util.ArrayMap;
import android.util.Log;

import androidx.annotation.NonNull;

@@ -66,8 +67,10 @@ public abstract class BindStage<Params> extends BindRequester {
    public final Params getStageParams(@NonNull NotificationEntry entry) {
        Params params = mContentParams.get(entry);
        if (params == null) {
            throw new IllegalStateException(
                    String.format("Entry does not have any stage parameters. key: %s",
            // TODO: This should throw an exception but there are some cases of re-entrant calls
            // in NotificationEntryManager (e.g. b/155324756) that cause removal in update that
            // lead to inflation after the notification is "removed".
            Log.wtf(TAG, String.format("Entry does not have any stage parameters. key: %s",
                            entry.getKey()));
        }
        return params;
@@ -92,6 +95,8 @@ public abstract class BindStage<Params> extends BindRequester {
     */
    protected abstract Params newStageParams();

    private static final String TAG = "BindStage";

    /**
     * Interface for callback.
     */
+3 −5
Original line number Diff line number Diff line
@@ -115,6 +115,9 @@ public final class NotifBindPipeline {
        mLogger.logManagedRow(entry.getKey());

        final BindEntry bindEntry = getBindEntry(entry);
        if (bindEntry == null) {
            return;
        }
        bindEntry.row = row;
        if (bindEntry.invalidated) {
            requestPipelineRun(entry);
@@ -223,11 +226,6 @@ public final class NotifBindPipeline {

    private @NonNull BindEntry getBindEntry(NotificationEntry entry) {
        final BindEntry bindEntry = mBindEntries.get(entry);
        if (bindEntry == null) {
            throw new IllegalStateException(
                    String.format("Attempting bind on an inactive notification. key: %s",
                            entry.getKey()));
        }
        return bindEntry;
    }