π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Decouple lock screen from BaseConfiguration via LockScreenHost
Manav Rathi4e602034d662
diff --git a/mobile/apps/auth/lib/core/configuration.dart b/mobile/apps/auth/lib/core/configuration.dartindex e772c6b218..11f5d2f16a 100644--- a/mobile/apps/auth/lib/core/configuration.dart+++ b/mobile/apps/auth/lib/core/configuration.dart@@ -4,11 +4,12 @@ import 'dart:typed_data';import 'package:ente_base/models/database.dart';import 'package:ente_configuration/base_configuration.dart';import 'package:ente_crypto_api/ente_crypto_api.dart';+import 'package:ente_lock_screen/lock_screen_host.dart';import 'package:flutter_secure_storage/flutter_secure_storage.dart';import 'package:shared_preferences/shared_preferences.dart';import 'package:sqflite_common_ffi/sqflite_ffi.dart';-class Configuration extends BaseConfiguration {+class Configuration extends BaseConfiguration implements LockScreenHost {Configuration._privateConstructor();static final Configuration instance = Configuration._privateConstructor();diff --git a/mobile/apps/locker/lib/services/configuration.dart b/mobile/apps/locker/lib/services/configuration.dartindex 1b860da7d1..4667639877 100644--- a/mobile/apps/locker/lib/services/configuration.dart+++ b/mobile/apps/locker/lib/services/configuration.dart@@ -1,9 +1,10 @@import 'package:ente_configuration/base_configuration.dart';+import 'package:ente_lock_screen/lock_screen_host.dart';import 'package:locker/services/collections/collections_service.dart';import 'package:locker/services/favorites_service.dart';import 'package:locker/services/files/offline/offline_file_storage.dart';-class Configuration extends BaseConfiguration {+class Configuration extends BaseConfiguration implements LockScreenHost {Configuration._privateConstructor();static final Configuration instance = Configuration._privateConstructor();diff --git a/mobile/packages/lock_screen/lib/lock_screen_host.dart b/mobile/packages/lock_screen/lib/lock_screen_host.dartnew file mode 100644index 0000000000..474bd83e11--- /dev/null+++ b/mobile/packages/lock_screen/lib/lock_screen_host.dart@@ -0,0 +1,5 @@+abstract class LockScreenHost {+ bool isLoggedIn();++ Future<void> logout();+}diff --git a/mobile/packages/lock_screen/lib/lock_screen_settings.dart b/mobile/packages/lock_screen/lib/lock_screen_settings.dartindex cd1432d8b6..9b92bcf016 100644--- a/mobile/packages/lock_screen/lib/lock_screen_settings.dart+++ b/mobile/packages/lock_screen/lib/lock_screen_settings.dart@@ -2,10 +2,10 @@ import "dart:convert";import "dart:io";import "dart:typed_data";-import "package:ente_configuration/base_configuration.dart";import "package:ente_crypto_api/ente_crypto_api.dart";import "package:ente_events/event_bus.dart";import "package:ente_events/models/signed_out_event.dart";+import "package:ente_lock_screen/lock_screen_host.dart";import "package:ente_pure_utils/ente_pure_utils.dart";import "package:ente_screen_cover/ente_screen_cover.dart";import "package:flutter_secure_storage/flutter_secure_storage.dart";@@ -40,12 +40,12 @@ class LockScreenSettings {Duration(minutes: 30),];- late BaseConfiguration _config;+ late LockScreenHost _config;late SharedPreferences _preferences;late FlutterSecureStorage _secureStorage;Future<void> init(- BaseConfiguration config, {+ LockScreenHost config, {bool hasOptedForOfflineMode = false,}) async {_config = config;diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen.dart b/mobile/packages/lock_screen/lib/ui/lock_screen.dartindex bdaf227f29..cd84016921 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen.dart@@ -2,8 +2,8 @@ import 'dart:io';import 'dart:math';import 'package:ente_accounts/ente_accounts.dart';-import 'package:ente_configuration/base_configuration.dart';import 'package:ente_lock_screen/auth_util.dart';+import 'package:ente_lock_screen/lock_screen_host.dart';import 'package:ente_lock_screen/lock_screen_settings.dart';import 'package:ente_lock_screen/ui/app_lock.dart';import 'package:ente_lock_screen/ui/local_authentication_unavailable_dialog.dart';@@ -16,7 +16,7 @@ import 'package:flutter_animate/flutter_animate.dart';import 'package:logging/logging.dart';class LockScreen extends StatefulWidget {- final BaseConfiguration config;+ final LockScreenHost config;const LockScreen(this.config, {super.key});