I'm trying to get `@Parcelize` to generate me the ...
# android
r
I'm trying to get
@Parcelize
to generate me the
CREATOR
for this class:
Copy code
interface Ringing {
    val token: String
    val other: Uuid
}
interface NoCall

@Parcelize
sealed class JCallState: Parcelable {
    data class IncomingRing(val caller: Uuid, override val token: String) : Ringing, JCallState() {
        override val other: Uuid
            get() = caller
    }
    data class OutgoingRing(val callee: Uuid, override val token: String) : Ringing, JCallState() {
        override val other: Uuid
            get() = callee
    }
    data class Connecting(val callee: Uuid) : JCallState()
    data class InCall(val other: Uuid, val token: String) : JCallState()
    data class Rejected(val other: Uuid) : NoCall, JCallState()
    data class HungUp(val x: String = "foo") : NoCall, JCallState()
}
But when trying to use it in aidl via
Copy code
parcelable JCallState;
It tells me there is no
CREATOR
.
c
Read the documentation. That’s not how the plugin works. https://developer.android.com/kotlin/parcelize
r
c
r
It's kotlin
Uuid
, which is
Serializable
, which is supported according to the documentation
👍🏼 1
c
Maybe it’s because how compiler plugins work and when the AIDL generator is invoked. I’d file an issue to https://issuetracker.google.com/issues/new?component=971607&template=1516698