Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] More debug options

laurenspriemb1ccc3917854
diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
index b9b17c5253..84840bc326 100644
--- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
+++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
@@ -126,10 +126,10 @@ class FaceMlService {
}
isInitialized = true;
- canRunMLController = !Platform.isAndroid;
+ canRunMLController = !Platform.isAndroid || kDebugMode;
/// hooking FaceML into [MachineLearningController]
- if (Platform.isAndroid) {
+ if (Platform.isAndroid && !kDebugMode) {
Bus.instance.on<MachineLearningControlEvent>().listen((event) {
if (LocalSettings.instance.isFaceIndexingEnabled == false) {
return;
@@ -153,7 +153,7 @@ class FaceMlService {
void listenIndexOnDiffSync() {
Bus.instance.on<DiffSyncCompleteEvent>().listen((event) async {
- if (LocalSettings.instance.isFaceIndexingEnabled == false) {
+ if (LocalSettings.instance.isFaceIndexingEnabled == false || kDebugMode) {
return;
}
// [neeraj] intentional delay in starting indexing on diff sync, this gives time for the user
diff --git a/mobile/lib/ui/settings/debug/face_debug_section_widget.dart b/mobile/lib/ui/settings/debug/face_debug_section_widget.dart
index 363d08699c..96dc71e6bf 100644
--- a/mobile/lib/ui/settings/debug/face_debug_section_widget.dart
+++ b/mobile/lib/ui/settings/debug/face_debug_section_widget.dart
@@ -92,18 +92,10 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
),
sectionOptionSpacing,
MenuItemWidget(
- captionedTextWidget: FutureBuilder<int>(
- future: FaceMLDataDB.instance.getIndexedFileCount(),
- builder: (context, snapshot) {
- if (snapshot.hasData) {
- return CaptionedTextWidget(
- title: LocalSettings.instance.remoteFetchEnabled
- ? "Remote fetch Enabled"
- : "Remote fetch Disabled",
- );
- }
- return const SizedBox.shrink();
- },
+ captionedTextWidget: CaptionedTextWidget(
+ title: LocalSettings.instance.remoteFetchEnabled
+ ? "Remote fetch enabled"
+ : "Remote fetch disabled",
),
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
@@ -121,6 +113,29 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
},
),
sectionOptionSpacing,
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: FaceMlService.instance.canRunMLController
+ ? "canRunML enabled"
+ : "canRunML disabled",
+ ),
+ pressedColor: getEnteColorScheme(context).fillFaint,
+ trailingIcon: Icons.chevron_right_outlined,
+ trailingIconIsMuted: true,
+ onTap: () async {
+ try {
+ FaceMlService.instance.canRunMLController =
+ !FaceMlService.instance.canRunMLController;
+ if (mounted) {
+ setState(() {});
+ }
+ } catch (e, s) {
+ _logger.warning('canRunML toggle failed ', e, s);
+ await showGenericErrorDialog(context: context, error: e);
+ }
+ },
+ ),
+ sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: FutureBuilder<double>(
future: FaceMLDataDB.instance.getClusteredToTotalFacesRatio(),