Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
Description
Component used: lifecycle-viewmodel-savedstate Version used: 2.3.0-alpha01
SavedStateHandle
is currently the only mechanism for accessing saved instance state from aViewModel
. However, it currently forces you to only use objects that can be put in a Bundle sinceset()
verifies the type of object immediately.It would be nice if
SavedStateHandle
could also support lazy serialization of objects - namely, having some equivalent to being able to register aonSaveInstanceState()
like callback.It seems like this is precisely what something like
SavedStateProvider
could fill. You couldregisterSavedStateProvider()
with aString key
and aSavedStateProvider
and theSavedStateHandle
would be responsible for callingsaveState()
on each provider to fill in theBundle
for that key.It would be the responsibility of the
ViewModel
for maintaining the non-bundable object outside ofSavedStateHandle
(i.e., having its ownMutableLiveData
) as well as in implementing theSavedStateProvider
.There'd need be some way to access the previously saved state - perhaps the underlying
get()
method would return aBundle?
indicating the previously saved state and/orregisterSavedStateProvider()
could return that sameBundle?
.