From 0e9b71e7a90f8a444d4bf681ed8fbcc8eb696a17 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 29 Jul 2019 00:37:01 -0700 Subject: [PATCH] Show notification on error --- .../topjohnwu/magisk/model/download/RemoteFileService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt b/app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt index 80e8126c1..71153f5da 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt @@ -49,7 +49,11 @@ abstract class RemoteFileService : NotificationService() { .doOnSubscribe { update(subject.hashCode()) { it.setContentTitle(subject.title) } } .subscribeK(onError = { Timber.e(it) - remove(subject.hashCode()) + finishNotify(subject.hashCode()) { notification -> + notification.setContentText(getString(R.string.download_file_error)) + .setSmallIcon(android.R.drawable.stat_notify_error) + .setOngoing(false) + } }) { val newId = finishNotify(it, subject) get()?.run {