Skip to content

Fixes #5296 - #5298

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_991955579
Oct 3, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_991955579

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Fixes #5296

Fix an issue where @ActivityRetainedSavedState SavedStateHandle fails to restore after a configuration change.

When an activity's retained SavedStateHandle is accessed for the first time only after a configuration change, its creation extras are re-initialized manually rather than through ViewModelProvider, which caused the ViewModel key required to create the SavedStateHandle to be lost. Preserve the original ViewModel key when the holder is first initialized so it can be restored across configuration changes.

Also upgrade the AndroidX Lifecycle dependency to 2.6.2 (along with compatible Activity, Fragment, and SavedState versions), which includes a required upstream fix for restoring saved state across activity recreation.

RELNOTES=Fixes #5296: Fix an issue where @ActivityRetainedSavedState SavedStateHandle fails to restore if accessed for the first time after a configuration change.

@copybara-service
copybara-service Bot force-pushed the test_991955579 branch 3 times, most recently from 3f9be4d to cf10c43 Compare October 2, 2026 23:53
@copybara-service copybara-service Bot changed the title Release ActivityRetainedSavedState restoration fix and upgrade AndroidX dependencies. Fixes #5296 Oct 2, 2026
Fix an issue where `@ActivityRetainedSavedState` `SavedStateHandle` fails to restore after a configuration change.

When an activity's retained `SavedStateHandle` is accessed for the first time only after a configuration change, its creation extras are re-initialized manually rather than through `ViewModelProvider`, which caused the ViewModel key required to create the `SavedStateHandle` to be lost. Preserve the original ViewModel key when the holder is first initialized so it can be restored across configuration changes.

Also upgrade the AndroidX Lifecycle dependency to 2.6.2 (along with compatible Activity, Fragment, and SavedState versions), which includes a required upstream fix for restoring saved state across activity recreation.

RELNOTES=Fixes #5296: Fix an issue where `@ActivityRetainedSavedState` `SavedStateHandle` fails to restore if accessed for the first time after a configuration change.
PiperOrigin-RevId: 992759144
@copybara-service
copybara-service Bot merged commit b3dc7ee into master Oct 3, 2026
5 checks passed
@copybara-service
copybara-service Bot deleted the test_991955579 branch October 3, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant