fix: android background backups (#21795)

* upload using dart client

* add connectivity api

* respect backup network setting

* comment as to why we need to wait for setForegroundAsync call

* log assets skipped due to network constraint

* dynamic spawning -> false

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
shenlong 2025-09-11 22:31:15 +05:30 committed by GitHub
parent 39c1ebf698
commit 722a464e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 755 additions and 27 deletions

View file

@ -0,0 +1,20 @@
import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/platform/connectivity_api.g.dart',
swiftOut: 'ios/Runner/Connectivity/Connectivity.g.swift',
swiftOptions: SwiftOptions(includeErrorClass: false),
kotlinOut: 'android/app/src/main/kotlin/app/alextran/immich/connectivity/Connectivity.g.kt',
kotlinOptions: KotlinOptions(package: 'app.alextran.immich.connectivity'),
dartOptions: DartOptions(),
dartPackageName: 'immich_mobile',
),
)
enum NetworkCapability { cellular, wifi, vpn, unmetered }
@HostApi()
abstract class ConnectivityApi {
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
List<NetworkCapability> getCapabilities();
}