Skip to content

Commit

Permalink
Stop cleaning up notification when service is destroyed.
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Feb 6, 2024
1 parent d27b199 commit 7874dea
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,17 @@ internal class BackupNotificationManager(private val context: Context) {
//
// This won't bring back the expected finish notification in this case,
// but at least we don't leave stuck notifications laying around.
nm.activeNotifications.forEach { notification ->
// only consider ongoing notifications in our ID space (storage backup uses > 1000)
if (notification.isOngoing && notification.id < 1000) {
Log.w(TAG, "Needed to clean up notification with ID ${notification.id}")
nm.cancel(notification.id)
}
}
// FIXME the service gets destroyed for each chunk when requesting backup in chunks
// This leads to the cancellation of an ongoing backup notification.
// So for now, we'll remove automatic notification clean-up
// and find out if it is still necessary. If not, this comment can be removed.
// nm.activeNotifications.forEach { notification ->
// // only consider ongoing notifications in our ID space (storage backup uses > 1000)
// if (notification.isOngoing && notification.id < 1000) {
// Log.w(TAG, "Needed to clean up notification with ID ${notification.id}")
// nm.cancel(notification.id)
// }
// }
}

fun onBackupFinished(success: Boolean, numBackedUp: Int?, size: Long) {
Expand Down

0 comments on commit 7874dea

Please sign in to comment.