Merge pull request #152 from zjs81/remove-wakelock

remove wakelock
This commit is contained in:
Ded
2026-02-11 08:18:57 -08:00
committed by GitHub
3 changed files with 10 additions and 20 deletions
-9
View File
@@ -5,7 +5,6 @@ import 'package:crypto/crypto.dart' as crypto;
import 'package:pointycastle/export.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import '../models/channel.dart';
import '../models/channel_message.dart';
@@ -776,9 +775,6 @@ class MeshCoreConnector extends ChangeNotifier {
_setState(MeshCoreConnectionState.connected);
// Enable wake lock to prevent BLE disconnection when screen turns off
await WakelockPlus.enable();
await _requestDeviceInfo();
_startBatteryPolling();
final gotSelfInfo = await _waitForSelfInfo(
@@ -887,9 +883,6 @@ class MeshCoreConnector extends ChangeNotifier {
_setState(MeshCoreConnectionState.disconnecting);
_stopBatteryPolling();
// Disable wake lock when disconnecting
await WakelockPlus.disable();
await _notifySubscription?.cancel();
_notifySubscription = null;
@@ -3215,8 +3208,6 @@ class MeshCoreConnector extends ChangeNotifier {
}
void _handleDisconnection() {
// Disable wake lock when connection is lost
WakelockPlus.disable();
_stopBatteryPolling();
for (final entry in _pendingRepeaterAcks.values) {
-1
View File
@@ -28,7 +28,6 @@ class BackgroundService {
foregroundTaskOptions: const ForegroundTaskOptions(
interval: 5000,
autoRunOnBoot: false,
allowWakeLock: true,
allowWifiLock: false,
),
);