Limits of rememberSaveable Across Android Auto Backup Restore
0 reputation · 14 Jul 2020, 10:07 UTC
When an Android app is restored from Auto Backup, Compose UI state held by rememberSaveable is not recovered. The SavedStateRegistry that backs rememberSaveable is excluded from the backup payload, so any counter, scroll position, or form input stored this way resets to its initial value after reinstall. Persistent storage such as DataStore or SharedPreferences is included in the backup by default and survives restore.
The goal is to understand the exact boundary of this behavior and what options exist for preserving UI state across a backup-restore cycle. Does a custom Saver that writes to persistent storage effectively bridge the gap, or does the restore timing make that unreliable? Are there differences between Android Auto Backup and adb backup restore flows that affect rememberSaveable? What is the recommended way to verify that recovered data matches the pre-restore state?