mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
Update flutter/lib/common.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2696,9 +2696,19 @@ class WakelockManager {
|
||||
}
|
||||
|
||||
static void disable(UniqueKey key) {
|
||||
// Mirror keep-awake behavior from enable; if wakelock was never enabled
|
||||
// due to user settings, there is nothing to disable.
|
||||
final keepAwake = mainGetLocalBoolOptionSync('keep-awake-during-outgoing-sessions');
|
||||
if (!keepAwake) {
|
||||
return;
|
||||
}
|
||||
if (_enabledKeys.remove(key)) {
|
||||
if (_enabledKeys.isEmpty) {
|
||||
WakelockPlus.disable();
|
||||
// Avoid calling WakelockPlus.disable on Linux, where special handling
|
||||
// is required.
|
||||
if (defaultTargetPlatform != TargetPlatform.linux) {
|
||||
WakelockPlus.disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user