StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
fix: declare data sync foreground service type
David Nashash272fe28be4da
diff --git a/.github/workflows/platform-smoke.yml b/.github/workflows/platform-smoke.ymlindex 245d3f8c..9408c3a5 100644--- a/.github/workflows/platform-smoke.yml+++ b/.github/workflows/platform-smoke.yml@@ -21,36 +21,43 @@ jobs:arch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: ''- api-level: 26runner: ubuntu-latestarch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: ''- api-level: 28runner: ubuntu-latestarch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: ''- api-level: 32runner: ubuntu-latestarch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: ''- api-level: 33runner: ubuntu-latestarch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: ''- api-level: 35runner: ubuntu-latestarch: x86_64target: defaultgpu: swiftshader_indirect+ adb_delay: -delay-adb- api-level: 36runner: ubuntu-latestarch: x86target: android-tvgpu: software+ adb_delay: -delay-adbruns-on: ${{ matrix.runner }}@@ -83,7 +90,7 @@ jobs:target: ${{ matrix.target }}emulator-boot-timeout: 900disable-linux-hw-accel: false- emulator-options: -no-window -gpu ${{ matrix.gpu }} -no-snapshot -noaudio -no-boot-anim -no-metrics -delay-adb+ emulator-options: -no-window -gpu ${{ matrix.gpu }} -no-snapshot -noaudio -no-boot-anim -no-metrics ${{ matrix.adb_delay }}profile: tv_1080pscript: |chmod +x gradlew tools/run-platform-smoke.sh tools/wait-for-emulator.shdiff --git a/app/src/main/java/com/streamvault/app/service/DownloadForegroundService.kt b/app/src/main/java/com/streamvault/app/service/DownloadForegroundService.ktindex eba2967a..7f5dcd00 100644--- a/app/src/main/java/com/streamvault/app/service/DownloadForegroundService.kt+++ b/app/src/main/java/com/streamvault/app/service/DownloadForegroundService.kt@@ -6,6 +6,7 @@ import android.app.NotificationManagerimport android.app.PendingIntentimport android.app.Serviceimport android.content.Context+import android.content.pm.ServiceInfoimport android.content.Intentimport android.util.Logimport android.os.Build@@ -64,8 +65,7 @@ class DownloadForegroundService : Service() {beginPendingCommand()val foregroundStarted = runCatching {- startForeground(- NOTIFICATION_ID,+ startDataSyncForeground(buildNotification(downloadItem = null,pendingCommand = true@@ -232,6 +232,18 @@ class DownloadForegroundService : Service() {private fun entryPoint(): DownloadServiceEntryPoint =EntryPointAccessors.fromApplication(applicationContext, DownloadServiceEntryPoint::class.java)+ private fun startDataSyncForeground(notification: Notification) {+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {+ startForeground(+ NOTIFICATION_ID,+ notification,+ ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC+ )+ } else {+ startForeground(NOTIFICATION_ID, notification)+ }+ }+private fun ensureDataSyncQuotaLease() {if (dataSyncQuotaLease != null) returnval owner = entryPoint().dataSyncQuotaOwner()diff --git a/data/src/main/java/com/streamvault/data/manager/recording/RecordingForegroundService.kt b/data/src/main/java/com/streamvault/data/manager/recording/RecordingForegroundService.ktindex 125de02e..e1fa5ac5 100644--- a/data/src/main/java/com/streamvault/data/manager/recording/RecordingForegroundService.kt+++ b/data/src/main/java/com/streamvault/data/manager/recording/RecordingForegroundService.kt@@ -6,6 +6,7 @@ import android.app.NotificationManagerimport android.app.PendingIntentimport android.app.Serviceimport android.content.Context+import android.content.pm.ServiceInfoimport android.content.Intentimport android.util.Logimport android.os.Build@@ -60,8 +61,7 @@ class RecordingForegroundService : Service() {beginPendingCommand()}runCatching {- startForeground(- NOTIFICATION_ID,+ startDataSyncForeground(buildNotification(activeCount = idleGate.activeRecordingCount,pendingCommand = idleGate.hasPendingCommands@@ -201,6 +201,18 @@ class RecordingForegroundService : Service() {private fun entryPoint(): RecordingServiceEntryPoint =EntryPointAccessors.fromApplication(applicationContext, RecordingServiceEntryPoint::class.java)+ private fun startDataSyncForeground(notification: Notification) {+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {+ startForeground(+ NOTIFICATION_ID,+ notification,+ ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC+ )+ } else {+ startForeground(NOTIFICATION_ID, notification)+ }+ }+private fun ensureDataSyncQuotaLease() {if (dataSyncQuotaLease != null) returnval owner = entryPoint().dataSyncQuotaOwner()diff --git a/tools/tests/platform-smoke-workflow-test.sh b/tools/tests/platform-smoke-workflow-test.shindex 9e094801..de9c3ebe 100755--- a/tools/tests/platform-smoke-workflow-test.sh+++ b/tools/tests/platform-smoke-workflow-test.sh@@ -55,6 +55,7 @@ grep -F 'data/build/outputs/androidTest-results/' "$smoke_workflow" >/dev/nullgrep -F 'data/build/reports/androidTests/' "$smoke_workflow" >/dev/nullgrep -F 'emulator-boot-timeout: 900' "$smoke_workflow" >/dev/nullgrep -F -- '-no-metrics' "$smoke_workflow" >/dev/null-grep -F -- '-delay-adb' "$smoke_workflow" >/dev/null+grep -F 'adb_delay: -delay-adb' "$smoke_workflow" >/dev/null+grep -F 'matrix.adb_delay' "$smoke_workflow" >/dev/nullprintf 'platform smoke workflow test passed\n'