From e658f9297d372f807b68017f1458cabf076135a9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 3 Dec 2018 01:52:36 -0500 Subject: [PATCH] Make progress notifications persist --- .../java/com/topjohnwu/magisk/components/Notifications.java | 3 ++- .../topjohnwu/magisk/components/ProgressNotification.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/full/java/com/topjohnwu/magisk/components/Notifications.java b/app/src/full/java/com/topjohnwu/magisk/components/Notifications.java index 244c2b4c8..36c8f34ae 100644 --- a/app/src/full/java/com/topjohnwu/magisk/components/Notifications.java +++ b/app/src/full/java/com/topjohnwu/magisk/components/Notifications.java @@ -107,7 +107,8 @@ public class Notifications { builder.setPriority(NotificationCompat.PRIORITY_LOW) .setSmallIcon(android.R.drawable.stat_sys_download) .setContentTitle(title) - .setProgress(0, 0, true); + .setProgress(0, 0, true) + .setOngoing(true); return builder; } } diff --git a/app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java b/app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java index 5c3ad5441..e597fbe18 100644 --- a/app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java +++ b/app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java @@ -50,14 +50,16 @@ public class ProgressNotification implements DownloadProgressListener { public void dlDone() { builder.setProgress(0, 0, false) .setContentText(Data.MM().getString(R.string.download_complete)) - .setSmallIcon(R.drawable.ic_check_circle); + .setSmallIcon(R.drawable.ic_check_circle) + .setOngoing(false); update(); } public void dlFail() { builder.setProgress(0, 0, false) .setContentText(Data.MM().getString(R.string.download_file_error)) - .setSmallIcon(R.drawable.ic_cancel); + .setSmallIcon(R.drawable.ic_cancel) + .setOngoing(false); update(); }