refactor(app): remove unsupported runtime and UI state

This commit is contained in:
Naveax committed 2026-09-03 22:44:25 +03:00
1 parent 9ac236a981
commit 0ed7bf27b5
19 files changed
+173 -381

No files matched your search

@@ -2,12 +2,9 @@ import 'package:flutter/material.dart';
import 'package:revoltvpn/logic/app_colors.dart';
import 'package:revoltvpn/logic/power_settings.dart';
/// Keeping the tunnel alive is an OS concern, not an app one.
///
/// Android stops background services of apps that are not exempt from Doze, and
/// removes the whole process group when its task is swiped away. There are
/// exactly two sanctioned ways around that, both requiring one user tap, and
/// neither can be enabled programmatically. This tile surfaces both.
/// Android may restrict background work when battery optimisation is active.
/// Surface the OS setting we can actually detect and request; do not promise
/// reboot/Always-on restoration that the per-session runtime cannot guarantee.
class BackgroundReliabilityTile extends StatefulWidget {
const BackgroundReliabilityTile({super.key});
@@ -35,8 +32,6 @@ class _BackgroundReliabilityTileState extends State<BackgroundReliabilityTile>
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
// The exemption is granted in a system dialog, so the only reliable moment
// to re-read it is when we come back to the foreground.
if (state == AppLifecycleState.resumed) _refresh();
}
@@ -68,8 +63,8 @@ class _BackgroundReliabilityTileState extends State<BackgroundReliabilityTile>
style: TextStyle(color: AppColors.textWhite, fontSize: 15),
),
subtitle: Text(
'Android stops background apps to save power. Disabling battery '
'optimisation is what keeps the VPN running when the app is closed.',
'Android may restrict background work to save power. ReVolt only '
'shows the system control it can verify.',
style: TextStyle(color: AppColors.textDim, fontSize: 12),
),
),
@@ -83,8 +78,8 @@ class _BackgroundReliabilityTileState extends State<BackgroundReliabilityTile>
? 'Battery optimisation: checking…'
: exempt
? 'Battery optimisation: disabled for Revolt VPN ✓'
: 'Battery optimisation: still active — the system may '
'stop the VPN in the background.',
: 'Battery optimisation: active — Android may stop '
'background VPN work.',
style: TextStyle(
color: exempt == true ? AppColors.accent : AppColors.textMuted,
fontSize: 12,