Skip to content

Commit 6c9d702

Browse files
ewhang5dogi
andcommitted
actions: less warnings is more (fixes #3759) (#3760)
Co-authored-by: dogi <[email protected]>
1 parent c7fa7ad commit 6c9d702

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "org.ole.planet.myplanet"
1010
minSdkVersion 21
1111
targetSdkVersion 34
12-
versionCode 1649
13-
versionName "0.16.49"
12+
versionCode 1650
13+
versionName "0.16.50"
1414
ndkVersion '21.3.6528147'
1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
vectorDrawables.useSupportLibrary = true

app/src/main/java/org/ole/planet/myplanet/callback/ProgressBroadcastReceiver.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.ole.planet.myplanet.callback
33
import android.content.BroadcastReceiver
44
import android.content.Context
55
import android.content.Intent
6+
import android.os.Build
67
import org.ole.planet.myplanet.model.Download
78
import org.ole.planet.myplanet.ui.dashboard.DashboardActivity
89

@@ -14,7 +15,12 @@ class ProgressBroadcastReceiver : BroadcastReceiver() {
1415

1516
override fun onReceive(context: Context, intent: Intent) {
1617
if (intent.action == DashboardActivity.MESSAGE_PROGRESS) {
17-
val download = intent.getParcelableExtra<Download>("download")
18+
val download: Download? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
19+
intent.getParcelableExtra("download", Download::class.java)
20+
} else {
21+
@Suppress("DEPRECATION")
22+
intent.getParcelableExtra("download")
23+
}
1824
if (onProgressChange != null) {
1925
onProgressChange!!.onProgressChange(
2026
String.format(

app/src/main/java/org/ole/planet/myplanet/ui/sync/ProcessUserDataActivity.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.content.SharedPreferences
88
import android.graphics.Color
99
import android.graphics.PorterDuff
1010
import android.net.Uri
11+
import android.os.Build
1112
import android.text.TextUtils
1213
import android.view.View
1314
import android.view.WindowManager
@@ -41,7 +42,12 @@ abstract class ProcessUserDataActivity : PermissionActivity(), SuccessListener {
4142
var broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
4243
override fun onReceive(context: Context, intent: Intent) {
4344
if (intent.action == DashboardActivity.MESSAGE_PROGRESS) {
44-
val download = intent.getParcelableExtra<Download>("download")
45+
val download: Download? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
46+
intent.getParcelableExtra("download", Download::class.java)
47+
} else {
48+
@Suppress("DEPRECATION")
49+
intent.getParcelableExtra("download")
50+
}
4551
val fromSync = intent.getBooleanExtra("fromSync", false)
4652
if (!fromSync) {
4753
checkDownloadResult(download)

0 commit comments

Comments
 (0)