Also allow auto-completion when entering the 12-word code.
This makes testing and entering the code easier
and does not compromise security as the word list is public anyway.
Before, we were always returnign a dummy RestoreSet,
if one was actually available or not.
Now, we also include the device name.
Note that it is planned to store the actual device name
and other metadata in an encrypted file
so that the backup server will not learn it.
The implementation is rudimentary for now.
E.g. The notification is only shown when a device init fails
which seems to be triggered after the first failure.
* to get rid of global state
* to have a testable architecture
* to allow for authenticated encryption
* to have a backup format version
* to potentially allow for other storage plugins
* With the upcoming changes, and the increasing number of external
libraries being used, plus the usage of Kotlin, it's getting harder
and harder to build this with the AOSP build system.
* It's best to leverage the existing gradle build system instead,
and use the apk that builds.
* Add a script which downloads the apk matching the tag if a tag is
checked out, otherwise downloads the latest.
For the current transport it is important to know when the backup ends,
because it resets its state only then and closes the ZIP file.
The detection was broken,
because some packages didn't have data to back up (LOG_EVENT_ID_NO_DATA_TO_SEND),
so the transport's methods weren't called and the package counter not updated.
The hacky solution is to use the BackupObserver to call back into the
transport at the end of backup.
Ideally, future transports won't need to know when the backup finishes.
We do this as a temporary fix, because our backup methods are not called
which are updating the package counter. So our mechanism to find out
about the end of the backup is broken. Excluding key-value backups fixes
it for now.
This is being done to implement automatic background updates
and not supposed to be part of a release.
The backup key will later be generated and shown to the user instead of
allowing them to choose their own.