mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 15:27:55 -04:00
Merge pull request #4279 from kiwix/Fixes#4278
Fixed: Application crashes on `FetchDownloadNotificationManager.getCancelNotification` method.
This commit is contained in:
commit
563e06e302
@ -73,6 +73,8 @@ class FetchDownloadNotificationManager @Inject constructor(
|
||||
val context: Context,
|
||||
private val downloadRoomDao: DownloadRoomDao
|
||||
) : DefaultFetchNotificationManager(context) {
|
||||
private val notificationBuilderLock = Any()
|
||||
|
||||
private val downloadNotificationManager: NotificationManager by lazy {
|
||||
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
}
|
||||
@ -258,6 +260,7 @@ class FetchDownloadNotificationManager @Inject constructor(
|
||||
download: Download,
|
||||
notificationBuilder: Builder
|
||||
): Notification {
|
||||
synchronized(notificationBuilderLock) {
|
||||
val downloadTitle = getDownloadNotificationTitle(download)
|
||||
val notificationTitle =
|
||||
runBlocking(Dispatchers.IO) {
|
||||
@ -287,6 +290,7 @@ class FetchDownloadNotificationManager @Inject constructor(
|
||||
)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getActionPendingIntent(
|
||||
fetch: Fetch,
|
||||
|
Loading…
x
Reference in New Issue
Block a user