Avoid using deprecated readList. Serialize and deserialize a String instead of a char array.

This commit is contained in:
Benoit Marty 2022-09-28 10:57:37 +02:00 committed by Benoit Marty
parent 2d90524763
commit 61a4dd2128

View File

@ -142,7 +142,8 @@ class LockScreenCodeView @JvmOverloads constructor(
var codeLength: Int = 0
constructor(source: Parcel) : super(source) {
source.readList(code, null)
val codeStr = source.readString().orEmpty()
code = codeStr.toMutableList()
codeLength = source.readInt()
}
@ -150,7 +151,7 @@ class LockScreenCodeView @JvmOverloads constructor(
override fun writeToParcel(out: Parcel, flags: Int) {
super.writeToParcel(out, flags)
out.writeList(code)
out.writeString(String(code.toCharArray()))
out.writeInt(codeLength)
}