KV] Don't set current token if no data was moved
Bug: 119299848
Test:
1) atest KeyValueBackupTaskTest
2) Manual:
- Run 'adb shell bmgr init' for the active transport to wipe all backup data
- Run 'adb shell dumpsys backup' and verify string 'Current: 0', i.e. the current token is
set to 0
- Create a test app implementing a BackupAgent that writes no data in onBackup() and
install it on the device
- Run 'adb shell bmgr backupnow --non-incremental <test_app_package>' to initiate a backup,
where --non-incremental flag makes sure PM is not added to the backup queue
- Run 'adb shell dumpsys backup' and verify string 'Current: 0' again
Change-Id: I595bea9874fd84d0c81b32a509c970a1b142872c
2 files changed