mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Implement start of backups payment integration work.
This commit is contained in:
committed by
Greyson Parrelli
parent
680223c4b6
commit
6b50be78c0
@@ -3,6 +3,16 @@ package org.signal.core.util
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import java.io.Serializable
|
||||
|
||||
fun <T : Serializable> Bundle.getSerializableCompat(key: String, clazz: Class<T>): T? {
|
||||
return if (Build.VERSION.SDK_INT >= 33) {
|
||||
this.getSerializable(key, clazz)
|
||||
} else {
|
||||
@Suppress("DEPRECATION", "UNCHECKED_CAST")
|
||||
this.getSerializable(key) as T?
|
||||
}
|
||||
}
|
||||
|
||||
fun <T : Parcelable> Bundle.getParcelableCompat(key: String, clazz: Class<T>): T? {
|
||||
return if (Build.VERSION.SDK_INT >= 33) {
|
||||
|
||||
Reference in New Issue
Block a user