mirror of https://github.com/ospab/ostp.git
On phones the tunnel dropped quickly and never reconnected. Root cause: the app had a foreground service and a wake lock but never asked to be exempt from battery optimization, so Doze / App Standby froze the whole VPN process when the screen went off. A frozen process means not just a dead socket but that the in-process reconnect logic — wall-clock suspend detection, the NetworkChanged handler, keepalive — never runs at all, which is exactly "reconnect doesn't work." Adds the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission and, on VPN start, prompts for the exemption when it isn't already granted (checked via isIgnoringBatteryOptimizations, so it asks once). Fired after the VPN consent so the two system dialogs don't stack. Socket protection on reconnect was already correct (try_connect_transport protects every new socket), so this targets the process-freeze, which is the part that stopped recovery. |
||
|---|---|---|
| .. | ||
| android | ||
| assets | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| README.md | ||
| analysis_options.yaml | ||
| android_icon.png | ||
| android_icon_backup.png | ||
| build.ps1 | ||
| build_android_jni.ps1 | ||
| devtools_options.yaml | ||
| ostp-client-release.apk | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| resize_icon.ps1 | ||
README.md
ostp_client
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.