ExportWorker: Split FGS notification ID from export notification ID

On old Android versions, WorkManager runs expedietd works on FGS and it
automatically removes the notification when work is finished resulting in
users never seeing the export finished notification.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-01-14 11:28:32 +07:00
parent d12339a454
commit baf08d600b

View File

@@ -61,7 +61,7 @@ class ExportWorker @AssistedInject constructor(
.setExpedited(OutOfQuotaPolicy.DROP_WORK_REQUEST)
.build()
Log.i(TAG, "Exporting $app.packageName")
Log.i(TAG, "Exporting ${app.packageName}")
WorkManager.getInstance(context).enqueue(oneTimeWorkRequest)
}
@@ -91,6 +91,7 @@ class ExportWorker @AssistedInject constructor(
private lateinit var notificationManager: NotificationManager
private val NOTIFICATION_ID = 500
private val NOTIFICATION_ID_FGS = 501
override suspend fun doWork(): Result {
val isDownload = inputData.getBoolean(IS_DOWNLOAD, false)
@@ -125,7 +126,7 @@ class ExportWorker @AssistedInject constructor(
override suspend fun getForegroundInfo(): ForegroundInfo {
return ForegroundInfo(
NOTIFICATION_ID,
NOTIFICATION_ID_FGS,
NotificationUtil.getExportNotification(appContext)
)
}