From 5132ae66b92c46afcab29582ea1e290baa9bb7d1 Mon Sep 17 00:00:00 2001 From: OneWay Date: Wed, 2 Sep 2026 08:37:43 +0800 Subject: [PATCH] fix: cancel stale progress notification on process start Notifications belong to the package and outlive the process: after the system kills the foreground service mid-download the frozen progress notification stays in the shade forever. A fresh process means no service is running, so any leftover notification is stale. --- app/src/main/java/com/example/research/ReSearchApplication.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/example/research/ReSearchApplication.kt b/app/src/main/java/com/example/research/ReSearchApplication.kt index cd8df1c..4a5a291 100644 --- a/app/src/main/java/com/example/research/ReSearchApplication.kt +++ b/app/src/main/java/com/example/research/ReSearchApplication.kt @@ -2,6 +2,7 @@ package com.example.research import android.app.Application import com.example.research.common.progress.DictionaryProgressStateHolder +import com.example.research.common.util.NotificationHelper import com.example.research.data.local.preferences.PreferencesManager import com.example.research.data.repository.LocalDictionaryRepository import com.example.research.feature.download.DownloadManager @@ -41,6 +42,8 @@ class ReSearchApplication : Application() { override fun onCreate() { super.onCreate() + NotificationHelper(this).cancelNotification() + preferencesManager = PreferencesManager(this) applicationScope.launch(Dispatchers.IO) { preferencesManager.sanitizeDictionarySources()