Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 10279986f24d1648952e740ea38c72b7bc44fdc7
Author: Elif Bilgin <elifbilgin@google.com>
Date: Tue Oct 26 16:59:42 2021
Resolving auto migration issue where SQLite keywords are failed to be escaped in column names.
The issue was arising from the part of AutoMigrationWriter generating code to transfer data from the old table to the new table, preserving the order of the columns. The SQL statement used did not utilize `` to escape the column names, resulting in a compiler error in scenarios where a SQLite keyword was being used as a column name.
Issue was repro'd in the tests by using the column name "index" and confirming the escape is working as expected with the new changes.
Test: AutoMigrationTest.java
Bug: 197133152
Change-Id: Idbed488acb2027fb1c0d9c302d1cc83ed5bfba2c
M room/room-compiler/src/main/kotlin/androidx/room/writer/AutoMigrationWriter.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/AutoMigrationDb.java
M room/integration-tests/testapp/schemas/androidx.room.integration.testapp.migration.AutoMigrationDb/1.json
https://android-review.googlesource.com/1870037
Branch: androidx-main
commit 10279986f24d1648952e740ea38c72b7bc44fdc7
Author: Elif Bilgin <elifbilgin@google.com>
Date: Tue Oct 26 16:59:42 2021
Resolving auto migration issue where SQLite keywords are failed to be escaped in column names.
The issue was arising from the part of AutoMigrationWriter generating code to transfer data from the old table to the new table, preserving the order of the columns. The SQL statement used did not utilize `` to escape the column names, resulting in a compiler error in scenarios where a SQLite keyword was being used as a column name.
Issue was repro'd in the tests by using the column name "index" and confirming the escape is working as expected with the new changes.
Test: AutoMigrationTest.java
Bug: 197133152
Change-Id: Idbed488acb2027fb1c0d9c302d1cc83ed5bfba2c
M room/room-compiler/src/main/kotlin/androidx/room/writer/AutoMigrationWriter.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/AutoMigrationDb.java
M room/integration-tests/testapp/schemas/androidx.room.integration.testapp.migration.AutoMigrationDb/1.json
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 29973ff449dbac17299da3c113017e01dbde09d8
Author: Ian Lake <ilake@google.com>
Date: Fri Mar 18 22:16:45 2022
Remove dependency on ViewModels in enableSavedStateHandles()
Rather than requiring the creation of a ViewModel as part of
the call to enableSavedStateHandle(), defer that creation
until createSavedStateHandle() is actually called. This
ensures that enableSavedStateHandles() is safe to call before
the owner is attached to a Context, etc.
Relnote: "You can now retrieve a previously registered
`SavedStateProvider` from a `SavedStateRegistry` via
`getSavedStateProvider()`."
Test: updated tests
BUG: 215406268
Change-Id: I7ea470c1af0385b8bc9d8ca653c84cc8d224e6cf
M savedstate/savedstate/api/restricted_current.txt
M savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.java
M savedstate/savedstate/api/current.txt
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandleSupport.kt
M lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleSupportTest.kt
M savedstate/savedstate/api/public_plus_experimental_current.txt
https://android-review.googlesource.com/2032091
Branch: androidx-main
commit 29973ff449dbac17299da3c113017e01dbde09d8
Author: Ian Lake <ilake@google.com>
Date: Fri Mar 18 22:16:45 2022
Remove dependency on ViewModels in enableSavedStateHandles()
Rather than requiring the creation of a ViewModel as part of
the call to enableSavedStateHandle(), defer that creation
until createSavedStateHandle() is actually called. This
ensures that enableSavedStateHandles() is safe to call before
the owner is attached to a Context, etc.
Relnote: "You can now retrieve a previously registered
`SavedStateProvider` from a `SavedStateRegistry` via
`getSavedStateProvider()`."
Test: updated tests
BUG: 215406268
Change-Id: I7ea470c1af0385b8bc9d8ca653c84cc8d224e6cf
M savedstate/savedstate/api/restricted_current.txt
M savedstate/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.java
M savedstate/savedstate/api/current.txt
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandleSupport.kt
M lifecycle/lifecycle-viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleSupportTest.kt
M savedstate/savedstate/api/public_plus_experimental_current.txt
il...@google.com <il...@google.com> #4
This decoupling has been complete and will be available in Lifecycle 2.5.0-alpha06.
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.