diff --git a/app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt b/app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt index e01cf620e43..61721d5467c 100644 --- a/app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt +++ b/app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt @@ -1,25 +1,9 @@ package org.schabi.newpipe.ktx -import android.os.Build import android.os.Bundle import android.os.Parcelable import androidx.core.os.BundleCompat -import java.io.Serializable -import kotlin.reflect.safeCast inline fun Bundle.parcelableArrayList(key: String?): ArrayList? { return BundleCompat.getParcelableArrayList(this, key, T::class.java) } - -inline fun Bundle.serializable(key: String?): T? { - return getSerializable(this, key, T::class.java) -} - -fun getSerializable(bundle: Bundle, key: String?, clazz: Class): T? { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { - bundle.getSerializable(key, clazz) - } else { - @Suppress("DEPRECATION") - clazz.kotlin.safeCast(bundle.getSerializable(key)) - } -}