Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Building note: run ./gradlew ... -x processReleaseMetadata
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 5f6e46e40a7e47924ac1d04426230466de7b6f38
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Tue Aug 07 15:57:10 2018
Fix ViewModel proguard rules
It removes allowshrinking modifier: a constructor
shouldn't be removed if it is unused, because it is
called through reflection
Test: manual =\
bug: 112230489
Change-Id: I215fe895fa12eb04172e9380a296e2d74567907c
M lifecycle/viewmodel/proguard-rules.pro
https://android-review.googlesource.com/727573
https://goto.google.com/android-sha1/5f6e46e40a7e47924ac1d04426230466de7b6f38
Branch: androidx-master-dev
commit 5f6e46e40a7e47924ac1d04426230466de7b6f38
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Tue Aug 07 15:57:10 2018
Fix ViewModel proguard rules
It removes allowshrinking modifier: a constructor
shouldn't be removed if it is unused, because it is
called through reflection
Test: manual =\
bug: 112230489
Change-Id: I215fe895fa12eb04172e9380a296e2d74567907c
M lifecycle/viewmodel/proguard-rules.pro
Description
Component used: Lifecycle
Version used: 2.5.0-alpha01
Currently the call to
enableSavedStateHandles()
creates aViewModel
using theViewModelStore
. This requires that the ViewModelStore be set on any component attempting to make the call, but there are scenarios where the call toenableSavedStateHandles
needs to happen before that in particular in the Fragment and Navigation components where the call is not immediately made when the object is constructed or sometimes not at all.If we remove the reliance on
SavedStateHandles
(and therefore view models), we can lean into theSavedStateProvider
APIs and the call toenableSavedStateHandles()
can be made before theViewModelStore
is set.