summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/java/com/wireguard/android/fragment
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-03-22 21:17:50 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2023-03-22 21:35:34 +0530
commit35c8c10b7e006c85f4fa20b1870fadb36107bade (patch)
treeb33d4f5a391e18782c574be6c547dbe1b8bfeb28 /ui/src/main/java/com/wireguard/android/fragment
parent91227e445a9411059aac5062fc863b1fcb5dcb60 (diff)
ui: address Parcelable API deprecations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/fragment')
-rw-r--r--ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt
index 872d0eab..315a6b86 100644
--- a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt
+++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt
@@ -5,6 +5,7 @@
package com.wireguard.android.fragment
import android.content.Context
+import android.os.Build
import android.os.Bundle
import android.text.InputType
import android.util.Log
@@ -265,7 +266,12 @@ class TunnelEditorFragment : BaseFragment() {
onSelectedTunnelChanged(null, selectedTunnel)
} else {
tunnel = selectedTunnel
- val config: ConfigProxy = savedInstanceState.getParcelable(KEY_LOCAL_CONFIG)!!
+ val config: ConfigProxy = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ savedInstanceState.getParcelable(KEY_LOCAL_CONFIG, ConfigProxy::class.java)!!
+ } else {
+ @Suppress("DEPRECATION")
+ savedInstanceState.getParcelable(KEY_LOCAL_CONFIG)!!
+ }
val originalName = savedInstanceState.getString(KEY_ORIGINAL_NAME)
if (tunnel != null && tunnel!!.name != originalName) onSelectedTunnelChanged(null, tunnel) else binding!!.config = config
}