Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public JSObject handleNotificationActionPerformed(Intent data, NotificationStora
}
String menuAction = data.getStringExtra(LocalNotificationManager.ACTION_INTENT_KEY);

dismissVisibleNotification(notificationId);

dataJson.put("actionId", menuAction);
JSONObject request = null;
try {
Expand All @@ -93,6 +91,15 @@ public JSObject handleNotificationActionPerformed(Intent data, NotificationStora
request = new JSObject(notificationJsonString);
}
} catch (JSONException e) {}

// Only dismiss the tapped notification when autoCancel allows it; the
// builder already applies setAutoCancel(), but this explicit cancel used
// to run unconditionally, making `autoCancel: false` a no-op on tap.
boolean autoCancel = request == null || request.optBoolean("autoCancel", true);
if (autoCancel) {
dismissVisibleNotification(notificationId);
}

dataJson.put("notification", request);
return dataJson;
}
Expand Down