Skip to content

Xiaomi, Redmi or POCO keeps closing your VPN? The HyperOS settings that fix it

HyperOS and MIUI close background apps to save battery, and your VPN is one of them. Four settings, from Xiaomi's support pages, that keep it connected.

PryVPN TeamPublished 4 min read
Illustration: recent-app cards on a phone, with the front card locked so the system keeps it running
Short answer

HyperOS and MIUI stop background apps to save battery, and a VPN is a background app. Set the VPN app's battery saver to No restrictions, turn on Autostart, and turn on Android's Always-on VPN with Block connections without VPN. Locking the app in the recent apps screen helps too. The battery and autostart paths were checked on a POCO with HyperOS 3.0.

You connect your VPN, lock the phone, and an hour later the key icon is gone. Messages arrive late, and the VPN app shows it's disconnected, even though you never tapped anything. On Xiaomi, Redmi and POCO phones this is common, and it's rarely the VPN's fault.

Why Xiaomi phones close VPNs

Every Android phone saves battery by limiting apps in the background. Android itself does it with Doze and App Standby, which, as the Android documentation explains, suspend network access for apps while the phone sits idle with the screen off.

Xiaomi's HyperOS, and MIUI before it, add their own layer on top: a per-app battery saver and an Autostart permission that decides whether an app may start or restart by itself in the background. With the default settings, a VPN can be paused or stopped like any other background app. When that happens, your traffic either stops or, without the kill switch, goes out unprotected.

For an app that must keep running, three settings do the job: No restrictions in its battery saver, autostart allowed, and the app locked in recent apps. Here's how to apply them to your VPN.

The four settings, step by step

Quick reference: four settings on Xiaomi, Redmi and POCO phones. Battery saver set to No restrictions, Autostart on, Always-on VPN with Block connections without VPN, and the app locked in recent apps
The four settings that keep a VPN running on HyperOS and MIUI

Menu names change slightly between HyperOS versions, MIUI and models. If yours differ, look for the same words.

1. Battery saver: No restrictions

  1. Open Settings › Apps, tap your VPN app (for example Pry VPN), then the row "Battery", which shows the battery use percentage.
  2. On the battery details page, tap "Battery saver".
  3. Choose "No restrictions".

2. Autostart: on

  1. Go to Settings › Apps and tap "Background autostart" (on the POCO we checked, it is a shortcut at the top of the Apps page).
  2. Find the VPN app in the list and turn on its switch.

Xiaomi's note on that page is worth repeating: turning Autostart off for apps you don't need saves battery, but don't turn it off for apps you rely on.

3. Always-on VPN and Block connections without VPN

These two Android settings are the real kill switch: Android starts the VPN when the phone boots, restarts it if it stops, and blocks apps' traffic while it's down.

  1. In Pry VPN, go to Settings › Kill Switch › Open VPN settings. Other VPN apps usually have a similar shortcut; otherwise, look for VPN in the Settings search.
  2. Tap the gear next to the VPN app.
  3. Turn on Always-on VPN and Block connections without VPN.

Our guide to the Android kill switch explains what each switch does and its side effects, such as hotel login pages that won't open.

4. Lock the app in recent apps

  1. Open the recent apps screen.
  2. Press and hold the VPN app's card and tap the lock.

A locked app isn't cleared when you tap "clear all", which is one more way VPNs get closed by accident.

How to check that it worked

  1. Connect the VPN and lock the phone for half an hour or more.
  2. Unlock it: the key icon should still be in the status bar, and the VPN app should show it's connected.
  3. If it isn't, check the four settings again, and turn off Ultra battery saver or any battery mode that limits background apps.

Pry VPN also tells you when it was closed by the system rather than by you, once, with the steps for your phone. Our battery settings help article lists them for every major brand.

If it still disconnects

  • Another VPN took over. Android runs one VPN at a time, and some cleaner, firewall or "secure Wi-Fi" apps work as a VPN. Our help article on other VPNs and work profiles explains what to check.
  • Dual apps or Second space. Apps in a separate space or profile don't go through the VPN in your main profile.
  • The network, not the phone. If the VPN drops only on one Wi-Fi, the cause is the network; see the general guide to a VPN that keeps disconnecting on Android.

Does "No restrictions" drain the battery?

Not by itself. It lets the VPN keep running; it doesn't make it do more work. WireGuard is light: Pry VPN sends only a tiny keep-alive packet every 25 to 55 seconds while connected, and does nothing in the background while disconnected. Android may still list the VPN high in battery usage because it encrypts the traffic of all your other apps; that work happens with any VPN.

Frequently asked questions

Are the steps the same on Redmi and POCO?

Yes. Redmi and POCO phones run the same HyperOS or MIUI as Xiaomi, so the settings are the same, with small naming differences between versions.

Should I also turn off battery optimization in Android's own settings?

On Xiaomi phones, the per-app Battery saver: No restrictions setting is where that lives. Samsung has its own version; see our guide to Samsung phones that close the VPN.

Is it safe to give a VPN Autostart?

Autostart only lets the app start itself in the background. Give it to apps you trust and need running, such as your VPN or your messaging app.

Will these settings survive a system update?

Usually, but it's worth checking them again after a major HyperOS update, because battery settings are part of the system.

If you're looking for a VPN that tells you when the system closed it, instead of failing silently, you can download Pry VPN.

Sources

  1. Xiaomi support: How to switch on/off the Background autostart for apps (Xiaomi 14T Pro)
  2. Xiaomi support: How to switch on/off the Background autostart for apps (REDMI 13C 5G)
  3. Android Developers: Optimize for Doze and App Standby
  4. Android Developers: VPN guide (Always-on VPN)

Tested on POCO (HyperOS 3.0, Android 16), 27-10-2026.

Spotted a mistake? Write to support@pryvpn.com and we'll fix it and update the date.

Go deeper

Guides and help articles on the same subject.

More from the blog

Try PryVPN for free

Free, no card, no activity logs. Download the Android app from this site and install it in a minute.

Version 0.1.25.91.68538 · 27.9 MB · Android 8.0 or later

How to install it

  • Free, no card
  • No activity logs
  • WireGuard encryption
  • Signed by PryVPN
QR code that opens the PryVPN download page
On a computer? Scan this code with your phone to download it there.

Your download has started

Install Pry VPN in about a minute. Android asks only once.

  1. Wait for the download

    It takes a few seconds. You can follow it at the top of the screen.

  2. Keep the file

    If your browser warns that this type of file can be harmful, choose to download it anyway.

  3. Open it

    Tap the notification when the download ends, or open Files › Downloads and tap pryvpn-0.1.25.91.68538.apk.

  4. Allow the install

    Android asks once: tap Settings, turn on “Allow from this source” for your browser and go back.

  5. Install

    Tap Install. If Android shows a security notice, tap “More details”, then “Install anyway”.

  6. Open and connect

    Tap Open, create your free account and tap Connect.

All install steps and checksums