Skip to content

Commit e51f0b7

Browse files
committed
Twelve: Parcelize Provider
Its parent ProviderIdentifier implements Parcelable, thus if any client were to parcel/unparcel a Provider it would instead wrongly get the parent CREATOR. Fixes a lint error. Change-Id: I5e556d0d197f9027710ff7c8a3aab7a8a6763f0d
1 parent 1d3e312 commit e51f0b7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/src/main/java/org/lineageos/twelve/models/Provider.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package org.lineageos.twelve.models
77

8+
import kotlinx.parcelize.Parcelize
89
import org.lineageos.twelve.datasources.MediaDataSource
910

1011
/**
@@ -17,9 +18,10 @@ import org.lineageos.twelve.datasources.MediaDataSource
1718
* @param name The name of the provider given by the user
1819
* @param visible Whether the user should be aware of it
1920
*/
21+
@Parcelize
2022
class Provider(
21-
type: ProviderType,
22-
typeId: Long,
23+
override val type: ProviderType,
24+
override val typeId: Long,
2325
val name: String,
2426
val visible: Boolean,
2527
) : ProviderIdentifier(type, typeId), UniqueItem<Provider> {

app/src/main/java/org/lineageos/twelve/models/ProviderIdentifier.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import kotlinx.serialization.Serializable
1919
@Serializable
2020
@Suppress("PROVIDED_RUNTIME_TOO_LOW")
2121
open class ProviderIdentifier(
22-
val type: ProviderType,
23-
val typeId: Long,
22+
open val type: ProviderType,
23+
open val typeId: Long,
2424
) : Comparable<ProviderIdentifier>, Parcelable {
2525
override fun compareTo(other: ProviderIdentifier) = compareValuesBy(
2626
this, other,

0 commit comments

Comments
 (0)