summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/BackupManagerService.java
Commit message (Collapse)AuthorAgeFilesLines
...
* More bmgr work; fix clear-data signallingChristopher Tate2009-06-161-3/+29
| | | | | | The 'list sets' and 'restore token#' commands from bmgr now do what they are supposed to. At this point we see the restore target's data being cleared properly and its agent being launched and invoked for restore.
* Sketch out a 'bmgr' command line toolChristopher Tate2009-06-151-15/+20
| | | | | Not finished, but eventually will allow adb shell access to the Backup Manager for testing purposes etc.
* Journal backup requests so that they won't be lost in a crashChristopher Tate2009-06-121-5/+94
| | | | | | | | | When an application requests a backup via dataChanged(), we now journal that fact on disk. The journal persists and is only removed following a successful backup pass. When the backup manager is started at boot time, it looks for any existing journal files and schedules a backup for the apps listed in them, on the expectation that the device shut down or crashed before a backup could be performed.
* Flesh out restore interface on manager; work up most of LocalTransportChristopher Tate2009-06-101-7/+39
|
* The rest of the basic flow for restoreChristopher Tate2009-06-101-94/+203
| | | | | Also moved the processOneBackup() implementation into the Thread class that runs the backup sequence.
* More restore plumbing, plus add suggested-backoff to transport APIChristopher Tate2009-06-101-43/+174
| | | | | | | | | | | Adds most of the code for a background-thread restore process, structured much like the backup thread. Broke some common functionality out into a helper function for doing a synchronous wait for a requested agent to attach. Added a method to IBackupTransport whereby the transport will be asked for an opinion on whether this is a good time for a backup to happen. It will reply with the results of its policymaking around backoff intervals, time-of-day selection, etc.
* Revamp IRestoreSession a bitChristopher Tate2009-06-081-0/+31
| | | | | | | | | We now supply an array of RestoreSet objects instead of wacky Bundle shenanigans. Also, pushed beginRestoreSession() out to the BackupManager concrete interface class so that SetupWizard can use it. (beginRestoreSession() is @hide, non-privileged apps cannot use it. It's also guarded by android.permission.BACKUP enforcement.)
* Add IRestoreSession interface for the restore flowChristopher Tate2009-06-071-25/+29
| | | | | | | | Restore is a fairly complicated, somewhat stateful process, so we introduce a new interface to encapsulate the various bits and pieces into a nicely separable component. In particular, this will make it much cleaner to open and interrogate an expensive-to-construct transport and then reuse it for the actual restore process itself.
* Adjust IBackupTransport interfaceChristopher Tate2009-06-071-4/+10
| | | | | | | Instead of just passing a package name to performBackup, pass the whole PackageInfo struct, explicitly including the list of signatures for the package. No need to make each transport look this up individually when it's a necessary part of the backup payload for each app.
* Fix tracking of backup participants across package remove/updateChristopher Tate2009-06-051-1/+8
|
* Fix backup agent unbindChristopher Tate2009-06-041-40/+1
| | | | | | | The handwritten binder transaction passing wasn't propagating the agent-destroy transaction to the client side. Oops. Also, remove obsolete run-one-agent code from the backup manager service.
* More backup workChristopher Tate2009-06-031-61/+230
| | | | | | | | | | | | | | | | | | | | * Put in some permission enforcement around agent connection notification and full-backup scheduling. * Full backup now applies to any package, not just backup participants who have declared their own android:backupAgent * The process of running the backup operation on the set of apps who have been queued for it is now done in a separate thread, with a notification mechanism from the main Backup Manager service to pass along new-agent binding knowledge. There's no longer one do-backup message on the primary Handler per target application. * The new backup thread sets up the desired transport now and passes along the newly backed-up data to it for each backup target. Two transports have been defined so far, GoogleTransport and AdbTransport; both are stubs at present. Note that at present the backup data output file seems to be properly created, but after doBackup() is called on the test app's agent it's still zero size.
* Retool the backup process to use a new 'BackupAgent' classChristopher Tate2009-05-311-94/+152
| | | | | | | | | | | | | | | Backups will be handled by launching the application in a special mode under which no activities or services will be started, only the BackupAgent subclass named in the app's android:backupAgent manifest property. This takes the place of the BackupService class used earlier during development. In the cases of *full* backup or restore, an application that does not supply its own BackupAgent will be launched in a restricted manner; in particular, it will be using the default Application class rather than any manifest-declared one. This ensures that the app is not running any code that may try to manipulate its data while the backup system reads/writes its data set.
* Hook up the backup data writer, and add a utility to read the backup data files.Joe Onorato2009-05-201-6/+15
|
* Get the backup calling through to the file backup helper.Joe Onorato2009-05-141-0/+3
| | | | | This includes some cleanup to make the parameters match between BackupService.onBackup and FileBackupHelper.performBackup.
* With this, the BackupService onBackup method is called.Joe Onorato2009-05-131-132/+150
| | | | | | It took a bunch of refactoring inside BackupManagerService, which is unfortunately all temporary anyway, but it unblocks a bunch of stuff.
* More backup testsJoe Onorato2009-05-071-1/+27
|
* Track install/removal/update of packages that provide backup servicesChristopher Tate2009-05-061-14/+115
|
* Pass null as savedState to indicate a full backup is requiredChristopher Tate2009-05-061-7/+4
|
* Add a Backup Manager interface to request a full backupChristopher Tate2009-05-061-15/+52
| | | | | | | Given a package name, the Backup Manager schedules a *full* (i.e. non- incremental) backup pass for that package. Also added the state-file handling for distinguishing to the target between the full and incremental backup requests.
* Further development of backup file handlingChristopher Tate2009-05-051-6/+20
| | | | | Put backup data in flight into /cache Close the files and delete the intermediates after backup pass
* Squashed commit of the following:Christopher Tate2009-05-041-2/+41
| | | | | | | | | | | | | | | | | | | | | Author: Christopher Tate <ctate@google.com> Date: Mon May 4 16:38:11 2009 -0700 IBackupService now passes ParcelFileDescriptors rather than int fds The outlines of backup state file / data file handling are now in place as well in the BackupManagerService. Author: Christopher Tate <ctate@google.com> Date: Thu Apr 30 12:40:19 2009 -0700 Hide the backup stuff for now Also adjust based on comments: + changed service intent string to conform to usage guidelines + only publish the IBackupService binder when invoked with the right intent action + docs tweaks
* Add android.backup.BackupManagerChristopher Tate2009-04-301-4/+8
| | | | | | | Also tweak the dataChanged() api to have the client supply a package name. We don't necessarily TRUST this, but we use it to narrow the set of packages requesting a backup pass, no longer blithely scheduling a pass for all packages associated with the caller's uid.
* First baby steps towards settings backupChristopher Tate2009-04-291-0/+191
This change adds a sketched outline of the backup system architecture, with all of the major pieces represented other than client-side helpers for specific types of data. IBackupManager and BackupService are public so that we can write test apps against SDK-domain symbols from the outset. What code exists in this change hasn't been tested and may crash. It's the beginnings of the real implementation but of course is barely begun.