If v2rayNG disconnects when you lock your screen, first check whether the VPN service has stopped or is still running but requests are timing out. Only relax the app’s battery restrictions if the service is stopping. If the connection stays up but battery drain is high, cut back on background tests and unnecessary proxy traffic, then repeat the same screen-off test to decide which settings to keep.
VPN disconnects when the screen is off: check whether the service has stopped
After unlocking your phone, don’t open v2rayNG or reconnect yet. Check the VPN status in Android settings, then make a new request to a webpage you’ve already tested. Opening the app first may change what’s happening, making it harder to tell whether the VPN stayed connected in the background or recovered only when you reopened it.
- Android shows the VPN as disconnected: First check whether Battery Saver is on, you cleared the recent apps list, or another app that uses Android’s VPN service was started. If this keeps happening only after the screen is locked, check v2rayNG’s battery settings.
- Android still shows the VPN as connected, but requests time out: This only means Android still has a VPN connection; it doesn’t confirm the server is reachable. Test the same server on a stable Wi-Fi connection and on mobile data. If the problem occurs only when switching networks, don’t enable auto-start yet.
- Web pages load, but one app can’t connect: Check v2rayNG’s per-app proxy settings and confirm that the app is included in the VPN as intended. App-list modes can vary by version, so read the description next to the setting before changing the list.
Battery optimization: add v2rayNG to the allowed list
The allowed list is usually labeled “Unrestricted” or “Don’t optimize.” This reduces battery restrictions for one app, but doesn’t guarantee the process will never stop or enable auto-start. Change one setting at a time and stop once the issue is resolved.
Record when the disconnect happens
Keep the same server and network, and confirm that a webpage loads while the screen is on. Lock the screen for 30 minutes, then check Android’s VPN status and try the same webpage again. If it normally takes an hour to disconnect, test for an hour rather than relying on a shorter test.
Open the app’s battery settings
Long-press the v2rayNG icon → “App info” → “App battery usage” or “Battery.” On a Pixel running Android 14, open the page with “Allow background usage” and review the background usage options. For other manufacturers, see the next section.
Relax one restriction at a time
If v2rayNG is set to “Restricted,” change it to “Optimized” and test again. If the service still stops, try “Unrestricted.” If Android instead provides a “Battery optimization” app list, set only v2rayNG to “Don’t optimize.”
Test again before granting more permissions
Repeat the test using the same network and screen-off duration. Don’t also change auto-start, lock the app in recent apps, or disable system-wide Battery Saver. If nothing changes, restore the original battery setting and check whether the issue is caused by a cleanup action or another VPN service.
Xiaomi, Samsung, and OPPO: background restrictions and auto-start settings
These are common menu paths, but names and availability vary by device. If a path has changed after a system update, search Settings for “app battery usage,” “background usage limits,” or “auto-start,” and make sure you’re changing settings for v2rayNG.
Xiaomi HyperOS
- Battery settings
- “Settings” → “Apps” → “Manage apps” → “v2rayNG” → “Battery saver”
- Setting to test
- “No restrictions”
- Auto-start settings
- “Settings” → “Apps” → “Permissions” → “Background autostart”
For disconnects that happen only when the screen is off, test the battery setting first. If v2rayNG doesn’t reconnect after a reboot, check background auto-start next.
Samsung One UI
- Where to manage apps
- “Settings” → “Battery” → “Background usage limits”; on some versions, open “Battery” under “Battery and device care”
- Check these lists first
- “Deep sleeping apps” and “Sleeping apps”
- Setting to test
- Remove v2rayNG from the sleeping apps list. If the issue persists, try adding it to “Never sleeping apps.”
Remove v2rayNG from the restricted list first; there’s no need to change sleep settings for other apps.
- OPPO ColorOS: Go to “Settings” → “Battery” and look for “App battery management.” Open v2rayNG and check whether “Allow background activity” is available. If the problem occurs only after a reboot, look for “Auto-launch” under “Settings” → “Apps” rather than enabling every background option.
- Disconnects only after tapping “Clear all”: First compare with a screen-off test where you leave recent apps alone. If your device lets you lock an app in recent apps, try that on its own. App locking applies to cleanup actions; it doesn’t replace battery settings or prevent a force stop from Android settings.
Reduce battery drain: cut background traffic and repeated tests
Seeing v2rayNG near the top of the battery usage list doesn’t mean it used the same share of your phone’s total battery. The VPN routes traffic for other apps, and Android may attribute some of that power use to the VPN app. Compare the phone’s overall battery level and how you used it, not just the app rankings.
Stop repeated testing
RecommendedDuring troubleshooting, one manual connection test with the current server is enough; there’s no need to repeatedly run batch latency tests. If an automation tool runs scheduled speed tests, subscription updates, or reconnects, pause those tasks overnight. A manual speed test doesn’t become a scheduled task just because the VPN stays connected.
Best for: a stable connection, but scheduled tasks or frequent speed tests were set up during troubleshooting
Limit which apps use the proxy
In v2rayNG, go to “Settings” → “Per-app proxy” and follow the list description to route only the apps that need the proxy through the VPN. After changing the setting, open one app that should use the proxy and one that should connect directly to check the results. Don’t exclude apps that must always use the VPN.
Best for: only a few apps need the proxy, while others frequently sync in the background
Disconnect when you’re done
If you use the VPN only at certain times, stop the service from the v2rayNG home screen when you’re finished. First confirm that apps can connect directly after disconnecting. If “Block connections without VPN” is enabled, apps may lose internet access when the service stops.
Best for: you don’t need an overnight connection or continuous VPN access
FAQ: reconnecting after a reboot, missing notifications, and settings reverting
Why doesn’t the VPN connect after a reboot, even with auto-start enabled?
Auto-start permission allows an app to launch under certain conditions; it doesn’t make Android establish a VPN connection. Unlock your phone once, then search Settings for “VPN” and open the settings for v2rayNG. If “Always-on VPN” is available and you need a persistent connection, enable it and test again after rebooting.
The notification disappeared. Was the app stopped in the background?
Not necessarily. Since Android 13, notification permission determines whether app notifications appear in the notification shade. First check the connection on Android’s “VPN” page, then go to “App info” → “Notifications” and check v2rayNG’s notification settings. Notifications and VPN traffic routing are separate things.
Unrestricted mode fixed screen-off disconnects, but why does the battery drain more overnight?
First pause any extra scheduled tests, then repeat the test under the same conditions. If you need a persistent connection but battery use is still high, run a comparison test on stable Wi-Fi. If “Optimized” also passes the same screen-off test, keep it instead of leaving restrictions relaxed.
The connection only stays up after switching servers. Do I still need to keep the app running?
If Android’s VPN connection stayed up in both tests and only requests to the old server timed out, keep the battery setting that was already working. Test both servers on the same network and confirm the results are repeatable. An allowed-list setting addresses Android’s background restrictions; it won’t fix server timeouts.