Skip to content Skip to sidebar Skip to footer

Backupagenthelper: Onrestore Not Getting Called

I installed the example BackupRestore from this link. https://android.googlesource.com/platform/development/+/0b3758ea4e53f9bfd0b112eaa4a7dd7b7f4040f5/samples/BackupRestore?autodi

Solution 1:

After checking the logs, I noticed a message:

I/Backup: [KeyValueRateLimiter] K/V backup for [package] aborted by rate limiter. next=1519165401410, current=1519088429345

So that means the backups are not being made until 2/20/2018, 5:23:21 PM. There is a rate limit for backups with Google Transport, so I am going to try Local Transport which has no rate limit.

Update: Switching to Local Transport seems to work. It was able to restore the values after an app uninstall/reinstall on my device.

Here is what I did to get it to work:

  • Copy the source files from the BackupRestore project into a new project.
  • Generate the Backup key for the manifest file from this website: https://developer.android.com/google/backup/signup.html
  • Run adb shell bmgr list transports to see the transports.
  • Run adb shell bmgr transport android/com.android.internal.backup.LocalTransport to change the transport to Local (Google transport will impose a rate limit)
  • Run adb shell bmgr backup [package] -- to backup app
  • Run adb shell dumpsys backup to see the pending backup files
  • adb shell bmgr run

  • adb uninstall [package name]

  • adb install -t [apk file] (for debugging I used -t)

  • Check that the values were restored during the install.

  • You can also click on Restore last Data button and the OnRestore event will fire, the last backup will be restored.

I struggled with this. I hope this helps someone.

Post a Comment for "Backupagenthelper: Onrestore Not Getting Called"