From e89c3de2d848d5bc5c8e2f2a612f9f79638b5928 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 11 May 2021 14:18:57 -0400 Subject: Fix NPE when NotificationEntry can't be found for action tap Fixes: 187840537 Test: tap some actions Change-Id: Ie9282295415821bff0fe3bb7cd0b96ef0fe184b8 --- .../systemui/statusbar/NotificationRemoteInputManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java index 70b3a7be02fb..ca81a7b43df6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java @@ -169,7 +169,7 @@ public class NotificationRemoteInputManager implements Dumpable { Pair options = response.getLaunchOptions(view); mLogger.logStartingIntentWithDefaultHandler(entry, pendingIntent); boolean started = RemoteViews.startPendingIntent(view, pendingIntent, options); - if (started) releaseNotificationIfKeptForRemoteInputHistory(entry.getKey()); + if (started) releaseNotificationIfKeptForRemoteInputHistory(entry); return started; }); } @@ -608,7 +608,11 @@ public class NotificationRemoteInputManager implements Dumpable { * (after unlock, if applicable), and will then wait a short time to allow the app to update the * notification in response to the action. */ - private void releaseNotificationIfKeptForRemoteInputHistory(String key) { + private void releaseNotificationIfKeptForRemoteInputHistory(NotificationEntry entry) { + if (entry == null) { + return; + } + final String key = entry.getKey(); if (isNotificationKeptForRemoteInputHistory(key)) { mMainHandler.postDelayed(() -> { if (isNotificationKeptForRemoteInputHistory(key)) { -- cgit v1.2.3-59-g8ed1b