Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Kuan-Ying Chou <
Link:
Remove ToT dependencies in wear:compose:compose-navigation
Expand for full commit details
Remove ToT dependencies in wear:compose:compose-navigation
Bug: 374102924
Test: n/a
Change-Id: Id057c7254a0282eab77a2facb4d278e3b5ccf784
Files:
- M
wear/compose/compose-navigation/samples/build.gradle
Hash: 285f596b323a37b82e07621acb990847b8cf4328
Date: Thu Oct 31 13:36:53 2024
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Kuan-Ying Chou <
Link:
Update Kotlin targets to 1.9
Expand for full commit details
Update Kotlin targets to 1.9
Update Kotlin target of savedstate and projects that depend on it to 1.9.
Bug: 374102924
Test: existing tests still pass
Change-Id: I442310ec57f7db381c16f95985a952deb9af57b2
Files:
- M
lifecycle/lifecycle-viewmodel-compose/build.gradle
- M
lifecycle/lifecycle-viewmodel-compose/samples/build.gradle
- M
lifecycle/lifecycle-viewmodel-savedstate/build.gradle
- M
lifecycle/lifecycle-viewmodel-testing/build.gradle
- M
savedstate/savedstate-ktx/build.gradle
- M
savedstate/savedstate/build.gradle
- M
savedstate/savedstate/src/nativeMain/kotlin/androidx/savedstate/internal/SynchronizedObject.native.kt
Hash: 73305d3cf9d9bfff42b1836ac0127032b7721496
Date: Tue Oct 29 17:27:51 2024
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Kuan-Ying Chou <
Link:
Add functions to encode serializable objects to and decode serializable objects from SavedState
.
Expand for full commit details
Add functions to encode serializable objects to and decode serializable objects from `SavedState`.
We do this by implementing an `Encoder` and a `Decoder` that writes and reads a `SavedState` output format for Kotlin Serialization (https://github.com/Kotlin/kotlinx.serialization). The format represents a Kotlin Serialization "primitive" as their corresponding `SavedState` supported type, and represents a "composite" in a `SavedState` with its property names as keys. Nested composites are represented by nested `SavedState`s.
Here are some other design choices we made:
1. We don't record size for collections and rely on the size of the `SavedState` in decoding so that collections and non-collections are treated the same.
2. To save space, we don't encode default values by default (it can be tweaked with `@EncodeDefault` with plugin-generated serializers).
3. To support nullable parameters with default arguments (e.g. `val a: String? = "foo"`) and for `SavedState` size to be correct for collections, we encode `null`s.
4. To keep things simple we don't support specifying custom `SerializersModule`s for now.
Please note that when using Kotlin Serialization and these functions as a `Parcelable` alternative on Android there's a performance overhead because of the extra serialization needed.
Also note that on Android we don't have built-in support for Android or Java specific types supported by `Bundle` or `Parcel` yet (e.g. `Exception`, `java.io.Serializable`, or `IBinder`). We may consider adding these types in the future.
Relnote: Add encodeToSavedState() and decodeFromSavedState() functions
Test: SavedStateCodecTest.kt
Bug: 374102924
Change-Id: I6f59faffaa3777bf56132a67f41b867d7a9663e5
Files:
- M
development/build_log_simplifier/messages.ignore
- M
docs-tip-of-tree/build.gradle
- A
savedstate/savedstate-samples/build.gradle
- A
savedstate/savedstate-samples/src/main/java/androidx/savedstate/SavedStateCodecSamples.kt
- M
savedstate/savedstate/api/current.txt
- M
savedstate/savedstate/api/restricted_current.txt
- M
savedstate/savedstate/bcv/native/current.txt
- M
savedstate/savedstate/build.gradle
- A
savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecAndroidTest.android.kt
- A
savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateDecoder.kt
- A
savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateEncoder.kt
- A
savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTest.kt
- A
savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.kt
- M
settings.gradle
Hash: 57162ea74b646ef7ae43397251fd4cd32e2d80c3
Date: Thu Oct 17 19:10:05 2024
ap...@google.com <ap...@google.com> #5
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit d19eb133d99947e3759464e781b1b932dd220184
Author: clarafok <clarafok@google.com>
Date: Mon Mar 28 17:05:01 2022
Update SavedStateRegistryOwner use in Compose UI
Part of the kotlinification process of SavedState library. Necessary
change to pass max_dep_version test
Test: ./gradlew compose:ui:ui-tooling:cC
Test: ./gradlew compose:ui:ui:cC
Bug: 220191285
Change-Id: I52769a5a1ce4e3e0636f3662db56528e0d0c036b
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/DisposableSaveableStateRegistryTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/AndroidViewTest.kt
M compose/ui/ui-tooling/build.gradle
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/ComposeViewAdapter.kt
M compose/ui/ui/build.gradle
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit 5028da7dc76757d75fb1d874a44836565dfb8410
Author: clarafok <clarafok@google.com>
Date: Thu Mar 24 12:05:30 2022
Update SavedStateRegistryOwner test class in Lifecycle
Part of the kotlinification process of SavedState library. Necessary
update to pass max_dep_versions test
Test: ./gradlew lifecycle:lifecycle-viewmodel-savedstate:cC
Bug: 220191285
Change-Id: I407317a471ff860340522f653ddbbb181fa65a22
M lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/TestComponent.kt
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 8c2885e747b132e2d0114ac031cc16169a5173d6
Author: clarafok <clarafok@google.com>
Date: Thu Mar 24 12:03:31 2022
Converted SavedStateRegistryOwner to Kotlin
Part of the kotlinification process of SavedState library.
SavedStateRegistryOwner is converted into Kotlin with source-incompatible changes. Dependencies in navigation, lifecycle-viewmodel-savedstate, and compose ui is updated to use latest SavedStateRegistryOwner.
Test: ./gradlew savedstate:savedState:cC
Test: ./gradlew savedstate:savedState-ktx:cC
Test: ./gradlew navigation:navigation-common:test
Test: ./gradlew navigation:navigation-common:cC
Bug: 220191285
Relnote: "`SavedStateRegistryOwner` is now in Kotlin. `SavedStateRegistry`
is now a property of `SaveStateRegistryOwner` for kotlin users which needs to be overridden via
overriding the property's default get() accessor."
Change-Id: I91fc991e6fdb11ea558a7158f319cfea4aae1e64
M savedstate/savedstate/api/restricted_current.txt
M navigation/navigation-common/api/restricted_current.txt
M savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.kt
M savedstate/savedstate/api/current.txt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M savedstate/savedstate/src/androidTest/java/androidx/savedstate/SavedStateRegistryTest.kt
M navigation/navigation-common/api/current.txt
M savedstate/savedstate-ktx/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.kt
M savedstate/savedstate/api/public_plus_experimental_current.txt
M navigation/navigation-common/src/main/java/androidx/navigation/NavBackStackEntry.kt
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit 6d15b0171dfefdc911f9eda905855cebbd8da231
Author: clarafok <clarafok@google.com>
Date: Wed Mar 30 16:55:50 2022
Update ViewTreeSavedStateRegistryOwner use in Compose UI
Part of the kotlinification process of SavedState library. Necessary
change to pass max_dep_version test
Test: ./gradlew compose:ui:ui-tooling:cC
Test: ./gradlew compose:ui:ui:cC
Test: ./gradlew compose:material:material:cC
Test: ./gradlew compose:material3:material3:cC
Bug: 220191285
Change-Id: I828e8c8c9568ded7451a58b1ac14ef6c713c5267
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/internal/ExposedDropdownMenuPopup.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidViewHolder.android.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/internal/ExposedDropdownMenuPopup.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/ComposeViewAdapter.kt
M compose/ui/ui/build.gradle
M compose/material3/material3/build.gradle
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/owners/SavedStateRegistryOwnerInFragmentTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/AndroidViewTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidDialog.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.android.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/ComponentActivity.kt
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit a40f4099e3f1cdc01f454fca93ff387e6bd2bc15
Author: clarafok <clarafok@google.com>
Date: Fri Apr 01 16:41:59 2022
Convert ViewTreeSavedStateRegistryOwnerTest to kotlin
Replace this test file with its identical but kotlin version from
savedstate-ktx.
Remove duplicated ViewTreeSavedStateRegistryOwnerTest from
savedstate-ktx
Test: ./gradlew savedstate:savedstate:cC
Bug: 220191285
Change-Id: Id2b78e0066526fcf8320246dad7160611a68c2b8
M savedstate/savedstate/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.kt
D savedstate/savedstate-ktx/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.kt
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit a870e08c713c95aec3740267dd4a606ec224b457
Author: clarafok <clarafok@google.com>
Date: Tue Mar 29 14:01:51 2022
Rename ViewTreeSavedStateRegistryOwnerTest from .java to .kt
Test: ./gradlew bOS
Bug: 220191285
Change-Id: I4ca05fe6b69c7c02084243175021692611d0c66d
M savedstate/savedstate/src/androidTest/java/androidx/savedstate/ViewTreeSavedStateRegistryOwnerTest.kt
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit 018966e693e2dd8e0930ed24eb63e9c851548c6c
Author: clarafok <clarafok@google.com>
Date: Fri Apr 01 16:44:09 2022
Convert ViewTreeSavedStateRegistryOwner to Kotlin
Deprecated helper function `View.findViewTreeSavedStateRegistryOwner()
from savedstate-ktx. Replaced with `View.getViewTreeSavedStateRegistryOwner()` from
`ViewTreeSavedStateRegistryOwner`
Test: ./gradlew checkApi all existing test pass
Bug: 220191285
RelNote: "ViewTreeSavedStateRegistryOwner in SavedState module is now in Kotlin.
Its new `View.findViewTreeSavedStateRegistryOwner()` has replaced the
one from View.kt which is now deprecated"
Change-Id: Ib9cbcc89c1973ea3ee9f554797afdb7763d52d52
M savedstate/savedstate/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
A savedstate/savedstate-ktx/api/current.ignore
M savedstate/savedstate/src/main/java/androidx/savedstate/ViewTreeSavedStateRegistryOwner.kt
A savedstate/savedstate-ktx/api/restricted_current.ignore
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentViewTreeTest.kt
M savedstate/savedstate/api/public_plus_experimental_current.txt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelTest.kt
M savedstate/savedstate-ktx/api/current.txt
M activity/activity/src/androidTest/java/androidx/activity/ContentViewTest.kt
M savedstate/savedstate-ktx/api/restricted_current.txt
M savedstate/savedstate-ktx/src/main/java/androidx/savedstate/View.kt
M savedstate/savedstate/api/current.txt
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatActivityViewTreeTest.kt
M savedstate/savedstate-ktx/api/public_plus_experimental_current.txt
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit dba2e248a6bd937753f8d12b7773c66acf85f297
Author: clarafok <clarafok@google.com>
Date: Fri Mar 25 15:56:56 2022
Rename ViewTreeSavedStateRegistryOwner from .java to .kt
Part of the kotlinification process of SavedState module.
Test: ./gradlew bOS
Bug: 220191285
Change-Id: I8197bf608a47b24a5a1698dfe4e89245e3b53d0b
M savedstate/savedstate/src/main/java/androidx/savedstate/ViewTreeSavedStateRegistryOwner.kt
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 6988752101f25dd03bdd3dd258c76764e7ed68db
Author: clarafok <clarafok@google.com>
Date: Thu Mar 31 16:10:28 2022
Convert SavedStateRegistry to Kotlin
Part of the kotlinification of SavedState module.
Test: ./gradlew checkApi all existing test pass
Bug: 220191285
Relnote: "SavedStateRegistry is now in Kotlin"
Change-Id: I2539228cdbb20892cb71dcc8f4fecc31cede9486
M savedstate/savedstate/api/restricted_current.txt
M savedstate/savedstate/api/current.txt
M savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.kt
M savedstate/savedstate/api/public_plus_experimental_current.txt
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 63fa258d9dc6350e9279346b826f1b659d7f93b2
Author: clarafok <clarafok@google.com>
Date: Wed Mar 30 12:04:15 2022
Rename SavedStateRegistry.java to .kt
Part of the kotlinification process of SavedState library.
Test: ./gradlew bOS
Bug: 220191285
Change-Id: Ifbbdb470308b7bc339344f70fbf90736b72da52a
M savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.kt
cl...@google.com <cl...@google.com>
ag...@google.com <ag...@google.com> #16
This change showed up on an androidx roll in Chrome as a sizeable binary size increase (our bots flag any commits > 16kb).
It's hard to justify binary size increases for pure refactorings. Would you be able to look into this and try and eliminate the regression? If there were new features being added here, please just let me know.
Here's the size breakdown:
One thing that popped out to me is that saveState
went from ~16 bytes to >1kb (within diff, filter for saveState
, then click the symbol and click "Show Disassembly" to see what might be the cause).
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 83bd33c1398b25c262bc243dd2eaf19e9aa49c59
Author: clarafok <clarafok@google.com>
Date: Mon Apr 11 11:03:06 2022
Fix Recreator.kt binary size increase
Size increased from 16b to 1kb within #saveState when switched to
bundleOf() which creates a new Pair object.
Refactored to use Bundle() instead.
Test: ./gradlew checkApi all existing test pass
Test: ./gradlew savedstate:savedstate:cC
Fixes: 220191285
Change-Id: I2edad8504ec506b0a227bfbebf7dc43ff2cad89d
M savedstate/savedstate/src/main/java/androidx/savedstate/Recreator.kt
ag...@google.com <ag...@google.com> #18
Thanks!
Description
Thanks to Lifecycle, all of the libraries that depend on the
SavedState
module up stream now have a Kotlin dependency.It should be relatively straightforward to land SavedState in Kotlin and it would be a first step toward making the library be KMP.