Skip to content

Commit 61e2291

Browse files
committed
change dataSync to specialUse for 6+ hour downloads on android 15
1 parent 19f9d4d commit 61e2291

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
minSdk = 16
3030
targetSdk = 35
3131
versionCode = 121
32-
versionName = "2.35.0"
32+
versionName = "2.36.0"
3333
}
3434

3535
buildTypes {

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
1111
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
1212
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
13-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
13+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
1414
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
1515

1616
<application
@@ -72,7 +72,7 @@
7272

7373
<service
7474
android:name="androidx.work.impl.foreground.SystemForegroundService"
75-
android:foregroundServiceType="dataSync"
75+
android:foregroundServiceType="specialUse"
7676
tools:node="merge" />
7777

7878
<provider

app/src/main/java/com/github/andreyasadchy/xtra/ui/download/StreamDownloadWorker.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.app.PendingIntent
66
import android.content.ContentResolver
77
import android.content.Context
88
import android.content.Intent
9-
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
9+
import android.content.pm.ServiceInfo
1010
import android.os.Build
1111
import android.util.Base64
1212
import android.util.JsonReader
@@ -901,8 +901,8 @@ class StreamDownloadWorker @AssistedInject constructor(
901901
}, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT))
902902
addAction(android.R.drawable.ic_delete, ContextCompat.getString(context, R.string.stop), WorkManager.getInstance(context).createCancelPendingIntent(id))
903903
}.build()
904-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
905-
ForegroundInfo(offlineVideo.id, notification, FOREGROUND_SERVICE_TYPE_DATA_SYNC)
904+
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
905+
ForegroundInfo(offlineVideo.id, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
906906
} else {
907907
ForegroundInfo(offlineVideo.id, notification)
908908
}

app/src/main/java/com/github/andreyasadchy/xtra/ui/download/VideoDownloadWorker.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.app.PendingIntent
66
import android.content.ContentResolver
77
import android.content.Context
88
import android.content.Intent
9-
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
9+
import android.content.pm.ServiceInfo
1010
import android.os.Build
1111
import android.util.Base64
1212
import android.util.JsonReader
@@ -1097,8 +1097,8 @@ class VideoDownloadWorker @AssistedInject constructor(
10971097
}, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT))
10981098
addAction(android.R.drawable.ic_delete, ContextCompat.getString(context, R.string.stop), WorkManager.getInstance(context).createCancelPendingIntent(id))
10991099
}.build()
1100-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
1101-
ForegroundInfo(offlineVideo.id, notification, FOREGROUND_SERVICE_TYPE_DATA_SYNC)
1100+
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
1101+
ForegroundInfo(offlineVideo.id, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
11021102
} else {
11031103
ForegroundInfo(offlineVideo.id, notification)
11041104
}

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ hilt-extension-compiler = "1.2.0"
1616
hilt-work = "1.2.0"
1717
kotlin = "2.0.20"
1818
ksp = "2.0.20-1.0.25"
19-
lifecycle = "2.8.5"
19+
lifecycle = "2.8.6"
2020
material = "1.12.0"
2121
media3 = "1.4.1"
22-
navigation = "2.8.0"
22+
navigation = "2.8.1"
2323
okhttp = "5.0.0-alpha.14"
2424
okio = "3.9.1"
2525
paging = "3.3.2"
2626
preference = "1.2.1"
2727
retrofit = "2.11.0"
2828
room = "2.6.1"
29-
serialization = "1.7.2"
29+
serialization = "1.7.3"
3030
swiperefreshlayout = "1.1.0"
31-
webkit = "1.11.0"
32-
work = "2.10.0-alpha03"
31+
webkit = "1.12.0"
32+
work = "2.10.0-alpha04"
3333

3434
[libraries]
3535
apollo-runtime = { module = "com.apollographql.apollo3:apollo-runtime", version.ref = "apollo" }

0 commit comments

Comments
 (0)