From the Mavic Pro simulator run on 2026-10-22: - The tablet's 2-minute sleep blanked the flight screen mid-flight. The flight screen now sets FLAG_KEEP_SCREEN_ON while it is open. - TapFly's GO got no answer from the aircraft and no error, so the button looked dead. ActiveTrack/TapFly starts now give up after 15 s with "the aircraft did not answer". - Tripod works in the air but the flight controller ignores it on the ground, so the gate asks to take off first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
525 B
Dart
15 lines
525 B
Dart
import 'package:flutter/services.dart';
|
|
|
|
/// Keeps the tablet's screen on while the flight screen is open: Android's
|
|
/// sleep timeout (2 min on the dev tablet) otherwise blanks the HUD mid-flight.
|
|
abstract final class ScreenAwake {
|
|
static const MethodChannel _channel = MethodChannel('pilotvault/screen');
|
|
|
|
/// Best-effort: a missing host (widget tests) just leaves the screen alone.
|
|
static Future<void> keepOn(bool on) async {
|
|
try {
|
|
await _channel.invokeMethod<void>('keepOn', on);
|
|
} catch (_) {}
|
|
}
|
|
}
|