From 348d7ccfa9e8e4ce3b322bd022ab644709aef4e5 Mon Sep 17 00:00:00 2001 From: Simon Pham Date: Sun, 7 Sep 2025 21:39:37 +0700 Subject: [PATCH] feat: add mediaProcessing foreground service type --- .../flutter_foreground_task/models/ForegroundServiceTypes.kt | 1 + lib/models/foreground_service_types.dart | 3 +++ 2 files changed, 4 insertions(+) diff --git a/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/ForegroundServiceTypes.kt b/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/ForegroundServiceTypes.kt index 315bca0..bea6654 100644 --- a/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/ForegroundServiceTypes.kt +++ b/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/ForegroundServiceTypes.kt @@ -70,6 +70,7 @@ data class ForegroundServiceTypes(val value: Int) { 10 -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE else null 11 -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE else null 12 -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) ServiceInfo.FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED else null + 13 -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING else null else -> null } } diff --git a/lib/models/foreground_service_types.dart b/lib/models/foreground_service_types.dart index 97327db..a307169 100644 --- a/lib/models/foreground_service_types.dart +++ b/lib/models/foreground_service_types.dart @@ -49,6 +49,9 @@ class ForegroundServiceTypes { /// Reserved for system applications and specific system integrations, to continue to use foreground services. static const systemExempted = ForegroundServiceTypes(12); + /// Service for performing time-consuming operations on media assets, like converting media to different formats. + static const mediaProcessing = ForegroundServiceTypes(13); + /// The raw value of [ForegroundServiceTypes]. final int rawValue; }