Commit graph

637 commits

Author SHA1 Message Date
Torsten Grote
2da989971b
Request @pm@ backup after initialization
to avoid a 2nd restore set being used.

This also changes the initialization behavior to only create the restore set folder and upload the metadata only when we actually need to. This way, double inits are not creating new restore sets on the backup destination.
2024-03-08 09:52:23 -03:00
Torsten Grote
19bfc41d95
Allow backups in metered network, if user wants that 2024-03-08 09:52:07 -03:00
Torsten Grote
4eaa806636
Expose scheduling options in the UI 2024-03-08 09:52:07 -03:00
Torsten Grote
f593b66e00
try more than once to upload metadata after APK backups
Failure to upload metadata after backup up APKs can be critical and flaky I/O can make it fail, so we try again.
2024-03-08 09:52:06 -03:00
Torsten Grote
e7e489e091
Only reschedule next app backup when not on USB storage
Currently, after a manual run, we need to schedule the background backups again, because the scheduling gets lost. However, we need to be careful not to do that when the backup destination is on removable storage. Then we don't want to run.
2024-03-08 09:52:06 -03:00
Torsten Grote
8a870d8942
Use WorkInfo for determining if a backup is already running
Backup and restore is not possible when a backup is running. We used to check notifications for this, but now can use WorkManager's WorkInfo which should be more reliable.

Also, we used to prevent the "Backup now" action when app backup was disabled. But the user may want to do a storage backup. This is now possible.
2024-03-08 09:52:06 -03:00
Torsten Grote
0c1898c198
Properly schedule/cancel backup workers when backup destination changes
When the user changes to USB storage, we need to cancel current schedulings, because the storage is not always available (maybe can use a trigger URI?). And if moving to a non-USB storage, we need to schedule backups again.

Unfortunately, there are two places in the code where we handle storage location changes. Ideally, those get unified at some point.
2024-03-08 09:52:06 -03:00
Torsten Grote
e615402458
During restore, show apps without APK as failed
Previously, we backed up APKs of apps we could not back up (even if APK backup was disabled) so the user had a chance to get at least the apps back when restoring. Now, it is enough to record metadata about the app and the user will be able to manually install the app. The install apps step won't be skipped anymore.
2024-03-08 09:52:06 -03:00
Torsten Grote
6e7bc89e2f
Respect when worker was stopped
and log worker ID as well as object, because we've seen two scheduled workers running at the same time, requesting a backup at the same time. This should not happen.
2024-03-08 09:52:06 -03:00
Torsten Grote
0d7156789e
Guard against BadParcelableException when getting app list
hopefully something rare, but it just happened to me while testing.

It seems it happens when there are many apps installed (>500) and the app list is open while a backup happens. Then, we keep reloading the list and hammer the package manager hard which it seems can't handle it. It does recover on its own though.
2024-03-08 09:52:05 -03:00
Torsten Grote
04fc90e9f7
Migrate to own backup scheduling 2024-03-08 09:52:05 -03:00
Torsten Grote
911a8dabf4
Expose time of next backup in UI
to help debugging scheduling issues
2024-03-08 09:52:05 -03:00
Torsten Grote
8da73ad8d1
Make 'Backup now' action use AppBackupWorker 2024-03-08 09:52:05 -03:00
Torsten Grote
49066be31b
Improve backup notification 2024-03-08 09:52:05 -03:00
Torsten Grote
fcd4e518a5
Move APK backup from BackupCoordinator to new ApkBackupManager
This is a preparation for doing APK backup ourselves in a worker and not hacked into the backup transport. The latter was prone to timeouts by the AOSP backup API. With a worker, we have a bit more control and can schedule backups ourselves.
2024-03-08 09:52:04 -03:00
Torsten Grote
0c8fe3ef20 Fix nullability issues that AOSP is complaining about now 2024-03-07 20:40:09 +05:30
Torsten Grote
c33486ee00 Adjust code for new library versions 2024-03-07 20:40:09 +05:30
Chirayu Desai
635a1ef9b4 strings: Call D2D alpha instead of experimental
Change-Id: I571989a04a2cfaa5684d2d182185799b48b51e9e
2024-02-23 23:37:00 +05:30
Chirayu Desai
2744ccdc7d strings: Call Storage Backup beta instead of experimental
* Let's make it less scary

Change-Id: I889b04eb68df836aea3c5cc4ca97acd3f4c3af54
2024-02-23 23:37:00 +05:30
Torsten Grote
8c27814407
Merge pull request #613 from grote/backup-binder
Use BackupRequester to request backup in chunks
2024-02-22 13:10:23 -03:00
Michael Bestas
a050e73f7d Update SetupWizard dark theme for U
Change-Id: I0a5b1a41cceba2b45b41cfd64e98b8105c8ad6b6
2024-02-22 01:18:45 +05:30
Torsten Grote
b47b4ade1e
Stop cleaning up notification when service is destroyed. 2024-02-13 16:20:02 -03:00
Torsten Grote
4014666c15
Improve notification progress reporting
It is still somewhat buggy when d2d is on, but this is easier to resolve when moving everything to own scheduling.
2024-02-13 16:20:02 -03:00
Torsten Grote
86c603e2d2
Use BackupRequester to request backup in chunks
Otherwise users with lots of installed apps with request a lot of packages causing binder transactions to reach their size limit and crash.
2024-02-13 16:20:02 -03:00
Torsten Grote
81fae1a240 Try to recover from corrupt metadata cache 2024-02-13 23:37:41 +05:30
Torsten Grote
6428399bed Tolerate unexpected exceptions in DocumentsStorage and ApkRestore 2024-02-13 23:36:46 +05:30
Torsten Grote
09b7cabd99 Use own notification ID for success notification
and cancel observer notification when backup is finished. This is because when the success channel is disabled by the user, the observer notification could stick around and would never get removed.
2024-02-13 23:34:59 +05:30
Torsten Grote
fcbd62ba3b Remove warning from d2d expert setting as we now disable system scheduling for d2d 2024-02-13 23:34:59 +05:30
Torsten Grote
c832cd9886 Remove logWorkInfo as some part of it isn't in AOSP version of workmanger
It was meant for debugging only anyway
2024-02-13 23:34:59 +05:30
Torsten Grote
a380445693 Show success notification in a separate notification channel
so the user can disable it. This will be more of an issue now that it comes also for scheduled background backups.
2024-02-13 23:34:59 +05:30
Torsten Grote
de51ad2cc9 Use our own scheduling when doing d2d backups (experimental) 2024-02-13 23:34:59 +05:30
Hosted Weblate
d1f0fef718 Import translations from Weblate
Co-authored-by: 0que <0que@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Michael Bestas <mkbestas@gmail.com>
Co-authored-by: Morris Son <morrisson42@gmail.com>
Co-authored-by: Mother is a Gambler <dahlan@disroot.org>
Co-authored-by: Pander <pander@users.sourceforge.net>
Co-authored-by: nautilusx <translate@disroot.org>
Co-authored-by: r5jyhte <ioulykttr@proton.me>
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/de/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/el/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/fr/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/id/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/nl/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/pl/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/ru/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_storage/ru/
Translation: CalyxOS/Seedvault
Translation: CalyxOS/Seedvault storage backup
2024-02-11 02:05:51 +05:30
Torsten Grote
9c4f9d8a67
Merge pull request #606 from seedvault-app/chore/version-bump
Bump version to 14-4.0 - D2D <3
2024-01-24 17:11:48 -03:00
Chirayu Desai
9097c8ced5 Bump version to 14-4.0 - D2D <3
Change-Id: Ida82c6eafa715069d62dc92eb19accf64ed6d51c
2024-01-24 21:28:09 +05:30
Steve Soltys
695c33e466
Merge pull request #603 from seedvault-app/bugfix/excluded-apk-backups
Stop backing up excluded app APKs
2024-01-19 09:41:51 -05:00
Steve Soltys
d1e577aec9 Stop backing up excluded app APKs 2024-01-19 03:34:30 +00:00
Torsten Grote
599240c79f
Show size of app backups in Backup Status screen 2024-01-17 13:37:58 -03:00
Torsten Grote
c362da8220
Store size of app backups in metadata 2024-01-16 12:14:28 -03:00
Torsten Grote
0319d733c1
Merge pull request #562 from seedvault-app/feature/d2d-transfer
Add experimental support for forcing D2D transfer backups
2024-01-15 11:24:27 -03:00
Steve Soltys
daaf0e0ecc Add experimental support for forcing D2D transfer backups 2024-01-12 00:12:43 -05:00
Chirayu Desai
57adc57c7f Bump version and set property for testing
* Bump version
  * 33030020 -> 13-3.2
  * 33030021 -> This, d2d test #478
  * 33030022 -> Next, to go back to normal build after testing #489
* Set the testing property to true so that the system
  sends us the right app list
  14597: Optionally have System-scheduled backups act as migrations | https://review.calyxos.org/c/CalyxOS/platform_frameworks_base/+/14597

Change-Id: I278091b6659db095716e01b6c3894ce345219283
2024-01-02 22:02:53 -05:00
Aayush Gupta
57be15abcf colors: Switch to public APIs for colors
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-11-30 21:39:20 +05:30
t-m-w
c2f737458c Initial support for backup of D2D-only apps
Allow backup of apps that would otherwise only support device-to-device
migration. This is an initial-support patch to help determine the
viability of this approach.

Known issues / TODO:
* System-scheduled backups will not handle D2D-only apps, unless
  accompanied by a framework change forcing OperationType.MIGRATION.
  Backups triggered by the connection of a USB device or by Seedvault's
  StorageBackupService (files) scheduling are not affected, so they
  *will* back up D2D-only apps as expected; otherwise, the user may
  need to perform a backup manually via Backup Now.
* Apps with `allowBackup="false"` will appear in Backup Status under
  "Installed Apps" rather than "Apps that do not allow data backup",
  and their status will always be blank until they have been backed
  up. If they are not eligible for migration, it will never change.

Other notes:
* The unit test for excluding the Storage Plugin provider from backups
  was discussed, deemed unnecessary, and removed.

Co-authored-by: Oliver Scott <olivercscott@gmail.com>
Change-Id: I5a23d68be66f7d8ed755f2bccb9570ab7be49356
2023-11-29 23:55:40 -05:00
Torsten Grote
5d19160602 Pretend to be a device to device data transport
Change-Id: Ieab13cb15b64e09798ec0c1081d3b3cd975e0811
2023-11-29 23:55:40 -05:00
Torsten Grote
640f5b73c6 Fix double start of restore session
We emit the install result of APKs at least two times. When there is no APKs to install, because APK backup was disabled, we would start the restore of app data two times.

This fix waits until the emitted install result is considered finished, so we only start data restore once.
2023-11-28 18:54:32 +05:30
Tommy Webb
18013c0379 Support installing via F-Droid Basic
If an app being restored was originally installed with F-Droid Basic,
try to install it using F-Droid Basic again.

Change-Id: Ib067389ba20d74596892e24efd561ab2918d62cb
2023-11-27 19:24:36 +05:30
Torsten Grote
392809274c
Merge pull request #563 from seedvault-app/bugfix/binder-exception-too-many-packages
Fix binder exception when restoring a large number of applications
2023-11-27 08:43:08 -03:00
Steve Soltys
b498dab9b1 Apply latest code review suggestions 2023-11-26 14:51:49 -05:00
Oliver Scott
97d2d18a73
fixup! Allow secondary user backup to USB
Issue: calyxos#1058
Change-Id: I4aaadef5954e9c091f7048bffd8e0ed700fdd2e6
2023-11-01 17:19:17 -04:00
Steve Soltys
b1a2c6d4cf Apply code review suggestions 2023-11-01 00:10:00 -04:00