From e9ac470f01bfb793637d076f1f3f0c92f9a6cde3 Mon Sep 17 00:00:00 2001 From: Kevin Han Date: Mon, 6 Apr 2020 20:44:58 -0700 Subject: [PATCH] Move row check to requestPipeline instead of start When aborting the state happens before the row check, it is possible to abort the row inflation task since we use entry.abortTask() as the underlying abortStage implementation. This CL moves the check to requestPipeline before the abortStage call. Bug: 153295369 Test: Call phone. See notification at top Change-Id: Ic48c2051f3d3aa655496b19530e7e055708afe14 --- .../statusbar/notification/row/NotifBindPipeline.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotifBindPipeline.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotifBindPipeline.java index 893e8490eb909..e4e3ebcf7671b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotifBindPipeline.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotifBindPipeline.java @@ -151,9 +151,12 @@ public final class NotifBindPipeline { * the real work once rather than repeatedly start and cancel it. */ private void requestPipelineRun(NotificationEntry entry) { - mLogger.logRequestPipelineRun(entry.getKey()); - final BindEntry bindEntry = getBindEntry(entry); + if (bindEntry.row == null) { + // Row is not managed yet but may be soon. Stop for now. + return; + } + mLogger.logRequestPipelineRun(entry.getKey()); // Abort any existing pipeline run mStage.abortStage(entry, bindEntry.row); @@ -177,10 +180,6 @@ public final class NotifBindPipeline { final BindEntry bindEntry = mBindEntries.get(entry); final ExpandableNotificationRow row = bindEntry.row; - if (row == null) { - // Row is not managed yet but may be soon. Stop for now. - return; - } mStage.executeStage(entry, row, (en) -> onPipelineComplete(en)); }