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.
This commit is contained in:
2026-09-02 08:37:43 +08:00
parent 5126c19f3c
commit 097bb23ce9
@@ -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()