LHA
LHA

Reputation: 9655

BackupAgent.onRestore not called when re-install app BUT called for bmgr restore command

I am testing my custom BackupAgent. The below is my test in Simulator & Eclipse ADT

Test 1 backup & restore using command ---- WORK WELL

  1. adb shell bmgr enabled
  2. adb shell bmgr backup app_package
  3. adb shell bmgr run ---------------------- Run backup (BackupAgent.onBackup called)
  4. On the app, I deleted some data
  5. adb shell bmgr restore app_package ------- Restore data from backup
  6. All is restored including some data I deleted on step 4 ------ WORK WELL

Test 2 Backup / uninstall app / re-install app ---- NOT WORK

  1. adb shell bmgr enabled
  2. adb shell bmgr backup app_package
  3. adb shell bmgr run ----------------------Run backup (BackupAgent.onBackup called)
  4. adb uninstall app_package --------------- Uninstall the app after backup
  5. Debug As / Android Application again ---- Application re-installed BUT NO data is restored ( data backup at step 3)

Updated

Anyone has any ideas? Thank you!

Upvotes: 8

Views: 988

Answers (1)

最白目
最白目

Reputation: 3644

very late, but have you tried setting the transport service to local?

adb shell bmgr list transports

prints

android/com.android.internal.backup.LocalTransport
* com.google.android.gms/.backup.BackupTransportService

change it to the local one

adb shell bmgr transport android/com.android.internal.backup.LocalTransport

Upvotes: 1

Related Questions