π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] gate cluster memory lanes to internal users
Priyanshu Dangare34547e9e71f4
diff --git a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dartindex 7adc166d00..86a3f596d7 100644--- a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart+++ b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart@@ -111,9 +111,11 @@ class MemoryLaneService {}schedulePersonRecompute(person.remoteID, force: force);}- final clusters = await _mlDataDB.getClustersForMemoryLane();- for (final cluster in clusters) {- schedulePersonRecompute(cluster, isCluster: true, force: force);+ if (flagService.internalUser) {+ final clusters = await _mlDataDB.getClustersForMemoryLane();+ for (final cluster in clusters) {+ schedulePersonRecompute(cluster, isCluster: true, force: force);+ }}}diff --git a/mobile/apps/photos/lib/ui/viewer/people/cluster_page.dart b/mobile/apps/photos/lib/ui/viewer/people/cluster_page.dartindex 578dc44114..7f6ffaf089 100644--- a/mobile/apps/photos/lib/ui/viewer/people/cluster_page.dart+++ b/mobile/apps/photos/lib/ui/viewer/people/cluster_page.dart@@ -15,7 +15,8 @@ import "package:photos/models/file_load_result.dart";import "package:photos/models/gallery_type.dart";import "package:photos/models/ml/face/person.dart";import "package:photos/models/selected_files.dart";-import "package:photos/service_locator.dart" show isLocalGalleryMode;+import "package:photos/service_locator.dart"+ show flagService, isLocalGalleryMode;import "package:photos/services/machine_learning/face_ml/feedback/cluster_feedback.dart";import "package:photos/services/machine_learning/ml_result.dart";import "package:photos/services/memory_lane/memory_lane_service.dart";@@ -119,13 +120,15 @@ class _ClusterPageState extends State<ClusterPage> {if (mounted) setState(() {});};_timelineNotifier.addListener(_timelineListener);- if (widget.personID == null) {- unawaited(- MemoryLaneService.instance.ensureTimelineReachability(- widget.clusterID,- isCluster: true,- ),- );+ if (flagService.internalUser) {+ if (widget.personID == null) {+ unawaited(+ MemoryLaneService.instance.ensureTimelineReachability(+ widget.clusterID,+ isCluster: true,+ ),+ );+ }}kDebugMode? ClusterFeedbackService.instance.debugLogClusterBlurValues(@@ -174,6 +177,7 @@ class _ClusterPageState extends State<ClusterPage> {}Future<void> _openMemoryLanePage() async {+ if (!flagService.internalUser) return;if (widget.personID == null &&MemoryLaneService.instance.hasReadyTimelineSync(widget.clusterID,@@ -194,11 +198,13 @@ class _ClusterPageState extends State<ClusterPage> {"${files.length} memories${widget.appendTitle}",_selectedFiles,widget.clusterID,- memoryLaneReady: MemoryLaneService.instance.hasReadyTimelineSync(- widget.clusterID,- isCluster: true,- ),- onMemoryLaneTap: _openMemoryLanePage,+ memoryLaneReady: flagService.internalUser+ ? MemoryLaneService.instance.hasReadyTimelineSync(+ widget.clusterID,+ isCluster: true,+ )+ : false,+ onMemoryLaneTap: flagService.internalUser ? _openMemoryLanePage : null,);final gallery = Gallery(appBar: appBar,