Commit graph

668 commits

Author SHA1 Message Date
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
cb9d3c701b Fix flaky metadata decoding test 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
Steve Soltys
6c7afd5f55 Fix binder exception when restoring a large number of applications 2023-10-31 21:38:36 -04:00
t-m-w
a091142a3f Allow restoring data for a greater number of apps
Restore app data in smaller batches when performing a full restoration
from a backup set, to prevent a Binder exception that causes the
process to fail entirely.

Android may encounter this exception when trying to call the
transport.startRestore() method if too many packages are involved; in
testing, 300 is an example of too many. Instead of using
IRestoreSession.restoreAll(), use restorePackages() and provide the
package names in batches of 100.

This issue reveals itself when using SeedVault with the D2D patch and
with an OS, such as stock Pixel OS, that includes an abundance of
packages. (Prior to this patch, the call to restoreAll() meant that the
framework would request data restoration for all packages installed,
even if they were not in the metadata.)

In logs, this issue appears as follows:
```
I BackupManagerService: Full restore; asking about 300 apps
W BpBinder: Large outgoing transaction of 528540 bytes, interface descriptor <uncached descriptor>, code 14
E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 528540)
E BackupManagerService: Unable to contact transport for restore: data parcel size 528540 bytes
```

Change-Id: Ibb5bb4572d9e873beccd6056da5fe3ae4dce71c2
2023-10-31 21:38:36 -04:00
Steve Soltys
b917293bbc Switch to Kotlin build scripts + version catalog 2023-10-19 00:22:51 -04:00
Steve Soltys
8297bb7087 Fix and improve E2E tests 2023-10-17 21:24:38 -04:00
Torsten Grote
cb95444ad4
Bump minSdk to 33 and upgrade unit test dependencies 2023-10-10 15:44:53 -03:00
Torsten Grote
74566b902a
Upgrade kotlin-bip39-jvm to 1.0.6
Bip39ComparisionTest was run before and after upgrading org.bitcoinj:bitcoinj-core to latest version to ensure that kotlin-bip39 is still behaving the same.

A small tweak in WordListTest was needed because WorldList constructor was made internal.
2023-10-10 15:44:52 -03:00
Torsten Grote
bc90378edf
Merge pull request #579 from seedvault-app/staging/android14-bp
Get app working in Android 14, built via Android.bp
2023-10-10 15:42:29 -03:00
Chirayu Desai
6cb3b30b84
restore: Runtime-registered broadcasts receivers must specify export behavior
See: https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported
Change-Id: I6f80a060370a0b202c277924ea8cbf565bc29d6e
2023-10-10 12:08:19 -03:00
Chirayu Desai
aa0e82cfca ApkInstaller: Supress NewApi for
* Pre-34, this was marked as @hide and @TestApi
* We were using it as a system app with hidden APIs allowed,
  and having added the framework android.jar to gradle
* 91fa0b1298
  made it public, so lint now complains. Silence that.

Change-Id: I5a1ec9847a25a0798726af3867d7660db1528a00
2023-10-09 00:16:15 +05:30
Chirayu Desai
978ab6897b 14: Bump to JavaVersion.VERSION_17
* AOSP android-14.0.0_r1 bumped Kotlin to 1.8.10
  which requires this

Change-Id: I91f51abbf0b303f3db88c5f4f81c570dd85a6510
2023-10-09 00:01:53 +05:30
Chirayu Desai
a6b32ac3d2 14: Update AOSP libs from gradle, from android-14.0.0_r1
* Compiled with a plain `m`, and then copied over
  from the paths noted in the comments

Change-Id: If5d399d839886c7fe044f5bb7088ed95259e6bf2
2023-10-09 00:01:53 +05:30
Steve Soltys
d678d9a960 Bump emulator image in Gradle task to android-34 2023-10-09 00:01:26 +05:30
Steve Soltys
bf5dc1958c Switch to GitHub actions for E2E tests 2023-10-09 00:01:26 +05:30
Chirayu Desai
fcdacf22a7 14: Add new permission FOREGROUND_SERVICE_DATA_SYNC
* Android.bp build means we get set to targetSdk 34 already

Fixes: Starting FGS with type dataSync targetSDK=34 requires permissions
See: https://developer.android.com/about/versions/14/changes/fgs-types-required#data-sync
Change-Id: I69932d778e870535522e08dff131f1bb1d128955
2023-10-08 00:39:29 +05:30
Chirayu Desai
e6f32510d5 Bump version to 14-3.3
* Android 14 is here!

Change-Id: Ic4249bb1d2a3ac03011f5b7608534ecd526e99c6
2023-10-08 00:39:29 +05:30
Michael Bestas
a83e36634c seedvault: Enable monochrome icon
Just use foreground icon for now
2023-09-26 02:36:50 +05:30
Michael Bestas
09d6131a1c seedvault: Update app icon
* Regenerate in android studio as a single xml instead of png
* Remove roundIcon, this was only used on sdk 25
* Use device accent for icon background
2023-09-26 02:36:50 +05:30
Hosted Weblate
f30acd8b2d Import translations from Weblate
Co-authored-by: Dan <jonweblin2205@protonmail.com>
Co-authored-by: Eric <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: Fjuro <ifjuro@proton.me>
Co-authored-by: František Oboňa <frantisekobona@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Micovec <jiri.vokrinek@email.cz>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/cs/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/es/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/he/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/sk/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/tr/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/uk/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/zh_Hans/
Translation: CalyxOS/Seedvault
2023-09-25 23:24:03 +05:30
Steve Soltys
6eaba0b87a Wait until storage location is initialized for e2e test 2023-09-25 22:52:01 +05:30
Steve Soltys
ced8803761 Switch ANDROID_SDK_HOME to ANDROID_HOME 2023-09-22 04:12:53 +00:00
Steve Soltys
29bd71bcc9 Intercept and assert on application data in e2e test 2023-09-21 06:51:43 +00:00
Steve Soltys
04c5089113 Start recording screen again if we get cut off after 3 minutes 2023-09-14 18:42:22 +00:00
Steve Soltys
59cef31183 Address review comments, add screen recording, use test backup data 2023-09-14 18:11:45 +00:00
Steve Soltys
f1238977d0 Add end-to-end emulator test running on CI 2023-09-14 18:11:45 +00:00
Steve Soltys
a922b69094 Add support for local development with an emulator 2023-09-14 17:33:30 +00:00