diff options
| author | 2021-05-11 14:18:57 -0400 | |
|---|---|---|
| committer | 2021-05-11 14:21:44 -0400 | |
| commit | e89c3de2d848d5bc5c8e2f2a612f9f79638b5928 (patch) | |
| tree | 982de51e4a6e8e2a3ddf3574451699cb83fa630d | |
| parent | ec6c6835ca1bfa24c53e13da58483764b14e0c4d (diff) | |
Fix NPE when NotificationEntry can't be found for action tap
Fixes: 187840537
Test: tap some actions
Change-Id: Ie9282295415821bff0fe3bb7cd0b96ef0fe184b8
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java | 8 |
1 files 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<Intent, ActivityOptions> 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)) { |