Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Auto lock time changed

Aman Raj Singh Mouryae5a5d9c08d91
diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart
index 629a55e4b7..f73c60c93d 100644
--- a/mobile/lib/main.dart
+++ b/mobile/lib/main.dart
@@ -68,7 +68,6 @@ const kFGHomeWidgetSyncFrequency = Duration(minutes: 15);
const kBGTaskTimeout = Duration(seconds: 25);
const kBGPushTimeout = Duration(seconds: 28);
const kFGTaskDeathTimeoutInMicroseconds = 5000000;
-const kBackgroundLockLatency = Duration(seconds: 3);
void main() async {
debugRepaintRainbowEnabled = false;
@@ -100,7 +99,6 @@ Future<void> _runInForeground(AdaptiveThemeMode? savedThemeMode) async {
locale: locale,
lightTheme: lightThemeData,
darkTheme: darkThemeData,
- backgroundLockLatency: kBackgroundLockLatency,
savedThemeMode: _themeMode(savedThemeMode),
),
);
diff --git a/mobile/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart b/mobile/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
index 26682f4a2c..10c2eb5558 100644
--- a/mobile/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
+++ b/mobile/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
@@ -136,7 +136,7 @@ class _AutoLockItemsState extends State<AutoLockItems> {
} else if (duration.inSeconds != 0) {
return "${duration.inSeconds}s";
} else {
- return "Disabled";
+ return "Immediately";
}
}
}
diff --git a/mobile/lib/ui/settings/lock_screen/lock_screen_options.dart b/mobile/lib/ui/settings/lock_screen/lock_screen_options.dart
index 755b64932d..6c7d9a2173 100644
--- a/mobile/lib/ui/settings/lock_screen/lock_screen_options.dart
+++ b/mobile/lib/ui/settings/lock_screen/lock_screen_options.dart
@@ -118,17 +118,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
} else if (duration.inSeconds != 0) {
return "in ${duration.inSeconds} second${duration.inSeconds > 1 ? 's' : ''}";
} else {
- return "Disabled";
- }
- }
-
- String _getAppLockType() {
- if (isPinEnabled) {
- return "Pin";
- } else if (isPasswordEnabled) {
- return "Password";
- } else {
- return "Device lock";
+ return "Immediately";
}
}
@@ -269,7 +259,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
right: 12,
),
child: Text(
- "Require ${_getAppLockType()} if away for some time .",
+ "Time after which the app will be locked after closing",
style: textTheme.miniFaint,
textAlign: TextAlign.left,
),
diff --git a/mobile/lib/ui/tools/app_lock.dart b/mobile/lib/ui/tools/app_lock.dart
index 30662c9197..cbc716d7f8 100644
--- a/mobile/lib/ui/tools/app_lock.dart
+++ b/mobile/lib/ui/tools/app_lock.dart
@@ -22,7 +22,7 @@ import "package:photos/utils/lock_screen_settings.dart";
/// `AppLock.of(context).disable();` or the convenience method `AppLock.of(context).setEnabled(enabled);`
/// using a bool argument.
///
-/// [backgroundLockLatency] determines how much time is allowed to pass when
+/// [_backgroundLockLatencyTimer] determines how much time is allowed to pass when
/// the app is in the background state before the [lockScreen] widget should be
/// shown upon returning. It defaults to instantly.
///
@@ -32,7 +32,6 @@ class AppLock extends StatefulWidget {
final Widget Function(Object?) builder;
final Widget lockScreen;
final bool enabled;
- final Duration backgroundLockLatency;
final ThemeData? darkTheme;
final ThemeData? lightTheme;
final ThemeMode savedThemeMode;
@@ -45,7 +44,6 @@ class AppLock extends StatefulWidget {
required this.savedThemeMode,
this.enabled = true,
this.locale = const Locale("en", "US"),
- this.backgroundLockLatency = const Duration(seconds: 0),
this.darkTheme,
this.lightTheme,
}) : super(key: key);
diff --git a/mobile/lib/utils/lock_screen_settings.dart b/mobile/lib/utils/lock_screen_settings.dart
index db3524a894..b4d7b0db49 100644
--- a/mobile/lib/utils/lock_screen_settings.dart
+++ b/mobile/lib/utils/lock_screen_settings.dart
@@ -22,12 +22,11 @@ class LockScreenSettings {
late SharedPreferences _preferences;
static const List<Duration> autoLockDurations = [
Duration(seconds: 0),
- Duration(seconds: 30),
+ Duration(seconds: 5),
+ Duration(seconds: 15),
Duration(minutes: 1),
Duration(minutes: 5),
- Duration(minutes: 15),
Duration(minutes: 30),
- Duration(hours: 1),
];
void init(SharedPreferences prefs) async {
_secureStorage = const FlutterSecureStorage();