After updating my phone, I noticed my Auto Clicker and WireGuard VPN kept getting killed in the background. I would set up a task, lock the screen, and ten minutes later, I'd unlock the phone to find the apps completely closed. I initially blamed the VPN. I thought the app was broken or just incompatible with the new update.

But then I noticed my HyperOS notifications delayed by hours, and my battery widgets stopped updating. The problem became obvious after locking the screen: HyperOS keeps killing apps on purpose.

Premium banner illustration for the HyperOS background app fix guide, featuring the text "Fix HyperOS Background Killer" and highlighting the No Restrictions setting.

If you rely on software that needs to run continuously, you have likely experienced this same frustration. HyperOS closes apps automatically because Xiaomi heavily prioritizes battery standby time and fluid UI animations over background multitasking. I spent a few days testing exactly how to bypass these HyperOS background restrictions, and here is how I finally got my phone to leave my processes alone.

What I Tested

1. Why HyperOS Keeps Killing Apps

When you transition from MIUI to HyperOS, the way the phone handles memory changes. Instead of relying on Android's normal memory management, HyperOS tries to predict what you are doing.

In my observations, the system checks running apps using a few strict rules. If its algorithms decide a background process isn't essential—even if you explicitly launched it—it kills the app to preserve battery. This makes the phone feel fast and saves battery overnight, but it is a massive headache if you actually want apps to run.

Here is what triggers the system to kill an app:

  • RAM Limits: The system's threshold for freeing up memory is very high. Simply opening a heavy game or the camera app was enough to trigger HyperOS to instantly kill background services like my VPN.
  • Battery Drain: If an app tries to keep the CPU awake while the screen is off, the battery manager flags it and cuts the app’s access to the CPU entirely.
  • Heat: If an app is doing heavy lifting in the background and the phone gets warm, the system will kill the app rather than let the CPU overheat.

2. The "Trinity Fix" for Background Apps

To get my apps to stay open, applying just one setting wasn't enough. You have to apply a combination of three specific settings. Xiaomi, Redmi, and POCO devices use the same approach, though menus might look slightly different.

Fix 1: Set Battery Usage to "No Restrictions"

By default, every app is set to "Battery Saver." This gives the OS permission to close the app whenever it wants. You must revoke this.

  1. Open the Settings app.
  2. Tap on Apps, then select Manage Apps.
  3. Search for your problematic app and open its App Info page.
  4. Tap on Battery Saver.
  5. Select No Restrictions.   
                                  
Screenshot of the HyperOS battery saver settings menu showing the 'No restrictions' option selected to prevent background apps from closing.

Fix 2: Enable Autostart

Even with battery restrictions lifted, the system can prevent an app from waking itself back up. Enabling Autostart fixes this.

On my POCO, I found this by long-pressing the app icon, tapping App Info, and toggling on Autostart. If it's hidden on your device, open the Security App > Manage Apps > Permissions > Autostart, and toggle it on from there.


Screenshot of the HyperOS background autostart menu in the Security app, showing permissions enabled for Auto Clicker and WireGuard VPN.

Fix 3: Lock Apps in Recent Tasks

Locking an app tells the RAM cleaner to ignore it when you swipe away your recent apps.

  1. Open the app you want to keep alive.
  2. Swipe up to open the Recent Tasks menu.
  3. Long-press the app's preview card.
  4. Tap the Padlock Icon.

3. Special App Cases

You don't need to do anything crazy for most apps, but a few need an extra step on top of the Trinity Fix:

  • Auto Clickers: Apply the Trinity Fix, then go to Settings > Accessibility and make sure the downloaded service is firmly toggled on. This prevents HyperOS from shutting down the accessibility service. If the system still kills it, you have to re-enable the accessibility permission entirely.
  • VPN Apps: Apply the Trinity Fix. To stop the HyperOS VPN disconnect issue for good, go to your phone's native Android VPN settings and turn on "Always-on VPN."
  • MacroDroid / Tasker: Apply the Trinity Fix, then disable Android's native Doze restrictions under Settings > Apps > Manage Apps > [Three Dots] > Special App Access > Battery Optimization. Set it to "Don't Optimize."
  • Battery Monitor Apps: Apply the Trinity Fix, and make sure you allow full notification access so the system doesn't freeze the home screen widget.

4. My Real Testing Results

I spent a solid week testing these settings on my POCO X6 Pro. My goal was simple: run an Auto Clicker and a WireGuard VPN simultaneously while the screen was locked, without the phone stepping in and ruining it.

Before the Fixes:
Out of the box, it was terrible. I would lock the screen, and within three minutes, the clicking would stop. I'd wake the phone up, and the VPN was disconnected. Even worse, my HyperOS notifications delayed by hours—I'd only get WhatsApp messages when I physically unlocked the phone.

After the Fixes:
I applied the Trinity Fix to both apps. I also disabled Memory Extension (virtual RAM) in the settings, because I noticed apps crashing when moved to slower storage memory.

The difference was night and day. I started the VPN, fired up the Auto Clicker, locked the screen, and left the phone sitting on my desk for four hours. When I woke it up, the VPN was completely stable with zero dropped connections. The clicker was still actively running on the screen. My notifications arrived instantly.

Battery Drain Impact:
Did it hurt my battery? Yes, slightly. During the four-hour test, my battery dropped by 4%. Normally, HyperOS would kill everything and only lose 1%. But sacrificing 3% battery to actually let my phone work the way I want is a trade-off I will gladly make.

What NOT to Do

Do not run random ADB debloat scripts to delete system files like com.miui.powerkeeper. I tried this on an older phone, and it broke my battery life, caused the phone to overheat while charging, and forced me to factory reset. Stick to the safe app settings I outlined above.

Conclusion

Having your apps close automatically makes a powerful phone feel useless. HyperOS is aggressively tuned to save battery and look smooth, but you don't have to live with it.

Once you realize that the phone checks for battery drain and RAM usage the moment the screen goes dark, you know exactly how to bypass it. Just remember the core rule: Set Battery Saver to No Restrictions, Enable Autostart, and Lock the app in the recent tasks menu. Apply that to your most important apps, and you won't have to deal with them closing in the background anymore.

Frequently Asked Questions

Why does HyperOS kill background apps?

It kills apps to free up your phone's RAM, keep the processor cool, and make sure your battery barely drops when you aren't actively using the phone.

Why is Autostart missing on my device?

If you have the HyperOS Autostart missing bug in your app info menu, Xiaomi probably hid it to stop you from using it. You can usually find the master list by opening the Security app, going to Manage Apps, then Permissions, and finally Autostart.

Why does my VPN disconnect after screen lock?

VPNs constantly send data back and forth. The moment your screen locks, HyperOS sees this data usage as a battery drain and cuts the connection. Setting the VPN to "No Restrictions" forces the system to leave it alone.

Does locking the app really help?

Locking an app stops the RAM cleaner from swiping it away, but it won't stop the battery manager from killing it. That's why you have to combine the lock icon with the "No Restrictions" battery setting for it to actually work.