Execute cleanup code in a new app instance after a restore

BackupAgent.onRestoreFinished() is not called in a context that
allows the use of ContentResolver. Given that DeskClock will be
killed by the restore procedure in short order after
onRestoreFinished(), a callback into the application is scheduled
for 10 seconds in the future. When the callback invokes a
BroadcastReceiver within DeskClock, it detects the presence of
 freshly restored data (via a shared preference) and executes a
clean up procedure from within the normal application context.

Bug: 22786516
Change-Id: Ia024529cf962ed6e6235aecc362dedf8f1cbd9c3
2 files changed