From 5a2948bf8a14e607bc07d57d35cedc354a69d9b4 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Thu, 16 Mar 2023 13:34:01 -0700 Subject: [PATCH 1/3] Fixes bad readSparseArray call in WorkflowLayout Crash on restore on Tiramisu / 33 or later --- .../main/java/com/squareup/workflow1/ui/WorkflowLayout.kt | 2 +- .../com/squareup/workflow1/ui/container/ViewStateFrame.kt | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/WorkflowLayout.kt b/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/WorkflowLayout.kt index 904313ce6..b230ef2c0 100644 --- a/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/WorkflowLayout.kt +++ b/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/WorkflowLayout.kt @@ -252,7 +252,7 @@ public class WorkflowLayout( constructor(source: Parcel) : super(source) { this.childState = if (VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) { - source.readSparseArray(SavedState::class.java.classLoader, SavedState::class.java)!! + source.readSparseArray(SavedState::class.java.classLoader, Parcelable::class.java)!! } else { @Suppress("DEPRECATION") source.readSparseArray(SavedState::class.java.classLoader)!! diff --git a/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/container/ViewStateFrame.kt b/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/container/ViewStateFrame.kt index 5447f134a..ea439918d 100644 --- a/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/container/ViewStateFrame.kt +++ b/workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/container/ViewStateFrame.kt @@ -32,10 +32,7 @@ internal data class ViewStateFrame( override fun createFromParcel(parcel: Parcel): ViewStateFrame { val key = parcel.readString()!! val viewState = if (VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) { - parcel.readSparseArray( - ViewStateFrame::class.java.classLoader, - Parcelable::class.java - )!! + parcel.readSparseArray(ViewStateFrame::class.java.classLoader, Parcelable::class.java)!! } else { @Suppress("DEPRECATION") parcel.readSparseArray(ViewStateFrame::class.java.classLoader)!! From 1d42ae0da12827a2d4da1081412927577297a942 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Thu, 16 Mar 2023 14:22:49 -0700 Subject: [PATCH 2/3] Releasing v1.10.0-beta03 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9ee60234f..fa2b6c707 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ android.useAndroidX=true systemProp.org.gradle.internal.publish.checksums.insecure=true GROUP=com.squareup.workflow1 -VERSION_NAME=1.10.0-beta03-SNAPSHOT +VERSION_NAME=1.10.0-beta03 POM_DESCRIPTION=Square Workflow From 7600ba4c14318fa60bbc34fe424295ad7e217ad1 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Thu, 16 Mar 2023 14:31:17 -0700 Subject: [PATCH 3/3] Finish releasing v1.10.0-beta03 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index fa2b6c707..9b4e72796 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ android.useAndroidX=true systemProp.org.gradle.internal.publish.checksums.insecure=true GROUP=com.squareup.workflow1 -VERSION_NAME=1.10.0-beta03 +VERSION_NAME=1.10.0-beta04-SNAPSHOT POM_DESCRIPTION=Square Workflow