mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 19:46:10 +01:00
Fixed: New plugin error or crash notifications overriding content of old ones
This commit is contained in:
parent
baacabdfbf
commit
e7fc60af72
2 changed files with 8 additions and 4 deletions
|
|
@ -132,7 +132,10 @@ public class CrashUtils {
|
|||
}
|
||||
|
||||
Intent notificationIntent = ReportActivity.newInstance(context, new ReportInfo(UserAction.CRASH_REPORT.getName(), logTag, title, null, reportString.toString(), "\n\n" + TermuxUtils.getReportIssueMarkdownString(context), true));
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
// Must ensure result code for PendingIntents and id for notification are unique otherwise will override previous
|
||||
int nextNotificationId = TermuxNotificationUtils.getNextNotificationId(context);
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(context, nextNotificationId, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent deleteIntent = null;
|
||||
|
||||
// Setup the notification channel if not already set up
|
||||
|
|
@ -144,7 +147,6 @@ public class CrashUtils {
|
|||
if (builder == null) return;
|
||||
|
||||
// Send the notification
|
||||
int nextNotificationId = TermuxNotificationUtils.getNextNotificationId(context);
|
||||
NotificationManager notificationManager = NotificationUtils.getNotificationManager(context);
|
||||
if (notificationManager != null)
|
||||
notificationManager.notify(nextNotificationId, builder.build());
|
||||
|
|
|
|||
|
|
@ -220,7 +220,10 @@ public class PluginUtils {
|
|||
reportString.append("\n\n").append(AndroidUtils.getDeviceInfoMarkdownString(context));
|
||||
|
||||
Intent notificationIntent = ReportActivity.newInstance(context, new ReportInfo(UserAction.PLUGIN_EXECUTION_COMMAND.getName(), logTag, title, null, reportString.toString(), null,true));
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
// Must ensure result code for PendingIntents and id for notification are unique otherwise will override previous
|
||||
int nextNotificationId = TermuxNotificationUtils.getNextNotificationId(context);
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(context, nextNotificationId, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent deleteIntent = null;
|
||||
|
||||
// Setup the notification channel if not already set up
|
||||
|
|
@ -236,7 +239,6 @@ public class PluginUtils {
|
|||
if (builder == null) return;
|
||||
|
||||
// Send the notification
|
||||
int nextNotificationId = TermuxNotificationUtils.getNextNotificationId(context);
|
||||
NotificationManager notificationManager = NotificationUtils.getNotificationManager(context);
|
||||
if (notificationManager != null)
|
||||
notificationManager.notify(nextNotificationId, builder.build());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue