Merge "Don't throw exception for inflation after removal" into rvc-dev am: ae72005349 am: c2e9ce1215
Change-Id: I6fcaa2e081516ce46cca32524f3ac8a40c08e7ec
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user