Fixed
Status Update
Comments
su...@google.com <su...@google.com> #3
I look closer and now I'm not sure what is the best behavior.
Currently keys()
does what javadoc says "all keys contained in this SavedStateHandle". Technically, before first onSaveInstanceState keys corresponding to SavedStateProviders aren't in the SavedStateHandle. However I can see, that SavedStateProvide is kinda promise that value will be in the SavedStateHandle in future.
I think we can do smth like:
fun keys() = mRegular.keySet() + mSavedStateProviders.keySet()
Ian, what do you think?
su...@google.com <su...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit da54c9d83ca533316fa95591a59b33eb2903a1e6
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Fri Dec 04 16:39:50 2020
SavedStateHandle#keys() now returns keys of Providers and LiveData-s
Fixes: 174713653
Test: improved SavedStateHandleTest#testKeySet
Change-Id: Ib586038aabe6601cd95e0d74af67f031439cf6ee
M lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
https://android-review.googlesource.com/1517919
Branch: androidx-master-dev
commit da54c9d83ca533316fa95591a59b33eb2903a1e6
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Fri Dec 04 16:39:50 2020
SavedStateHandle#keys() now returns keys of Providers and LiveData-s
Fixes: 174713653
Test: improved SavedStateHandleTest#testKeySet
Change-Id: Ib586038aabe6601cd95e0d74af67f031439cf6ee
M lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
Description