Android backs up your app's database unless you tell it not to
A code audit flagged something in one of my Android apps that I'd never thought about: the manifest didn't set android:allowBackup.
If you leave it out, it defaults to true. That turns on Android Auto Backup, which can copy your app's data, local SQLite database included, up to the user's Google account. Later it can quietly restore that copy on a reinstall or a new phone.
For a lot of apps that's fine, maybe even nice. Mine is local-first and already has its own backup option, which the user controls. Auto Backup was a second copy running underneath it that I never planned for, and it ran even with the app's own backup turned off. The part that worried me was the restore. An older database coming back over newer data is the kind of bug you don't notice until someone's data is just gone.
I never actually hit it. The audit caught it first. The fix is one line in the manifest:
<application
android:allowBackup="false"
... >
To make sure it took, I checked the installed package:
adb shell dumpsys package your.package.name
ALLOW_BACKUP should no longer show up in the flags.
If your app manages its own backups, it's worth a quick look at your manifest to make sure Android isn't running a second one behind your back.