Fix NPE when NotificationEntry can't be found for action tap

Fixes: 187840537
Test: tap some actions
Change-Id: Ie9282295415821bff0fe3bb7cd0b96ef0fe184b8
This commit is contained in:
Jeff DeCew
2021-05-11 14:18:57 -04:00
parent ec6c6835ca
commit e89c3de2d8

View File

@@ -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)) {