Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

ML background consent + race fix

laurenspriem5bb0c35a03d3
diff --git a/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart b/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
index 97ce87853c..25abf6558e 100644
--- a/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
@@ -209,8 +209,8 @@ class ComputeController {
if (ml) {
if (_currentRunState == ComputeRunState.runningML) {
_currentRunState = ComputeRunState.idle;
+ _waitingToRunML = false;
}
- _waitingToRunML = false;
} else if (stream) {
if (_currentRunState == ComputeRunState.generatingStream) {
_currentRunState = ComputeRunState.idle;
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
index 5aa47be242..0fbcc27108 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
@@ -361,6 +361,10 @@ class MLService {
return;
}
try {
+ if (!hasGrantedMLConsent) {
+ _logger.info("runAllML called without ML consent, skipping");
+ return;
+ }
final MLMode mode = isLocalGalleryMode
? MLMode.localGallery
: MLMode.enteGallery;