π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
import "dart:io" show Platform;
import "package:device_info_plus/device_info_plus.dart";
import "package:photos/service_locator.dart"
show flagService, isLocalGalleryMode;
import "package:photos/utils/ram_check_util.dart";
final webGpuExecutionPolicy = WebGpuExecutionPolicy();
// Rust owns durable quarantine and GPU adapter compatibility.
class WebGpuExecutionPolicy {
Future<int?>? _androidSdkFuture;
Future<bool> isEligible() async {
if (!Platform.isAndroid ||
(!isLocalGalleryMode && !flagService.webGPUEnabled) ||
!enoughRamForLocalIndexing) {
return false;
}
final sdk = await (_androidSdkFuture ??= _readAndroidSdk());
return sdk != null && sdk >= 31;
}
static Future<int?> _readAndroidSdk() async {
try {
return (await DeviceInfoPlugin().androidInfo).version.sdkInt;
} catch (_) {
return null;
}
}
}