Stop Clash Android Proxy Drops: Battery Optimization and Background Lock Steps
On Android, Clash often looks fine until you switch apps, lock the screen, or leave the phone idle overnight. Then the VPN notification disappears, browsers fall back to a dead path, and subscription refresh never runs on schedule. Nine times out of ten the culprit is not your YAML—it is battery optimization, background restrictions, and vendor-specific autostart policies starving the foreground service that holds your tunnel open. This guide gives concrete menus to open, a sane verification order, and the few cases where you should look at DNS or rules instead.
How power management shows up in real life
Android treats long-running network work as expensive. A Clash-compatible client usually runs as a VPN service so it can steer traffic, but OEM skins still apply doze, app standby, and aggressive memory reclaim on top. Symptoms cluster into three buckets that are easy to confuse with “bad nodes” or “broken subscriptions.”
- Instant drop after leaving the UI: you tap Home, return thirty seconds later, and the tunnel is gone. Classic sign the system paused or killed the service holder.
- Random disconnects on a full battery: still happens—power savers and “performance modes” can throttle background timers even when the percentage icon looks healthy.
- Manual update works, scheduled refresh does not: the profile download succeeds when you poke the button, but overnight jobs never fire. That pattern screams deferred background execution, not a dead URL.
Before you chase remote servers, confirm whether Android is allowed to keep your client process and its VPN service alive. The rest of this article assumes you already granted the one-time VPN permission prompt; if that prompt reappears constantly, clear the client data once, re-import, then revisit the battery steps here.
Step 1 — Turn off battery optimization for your Clash client
Stock Android exposes Battery → App battery usage (wording varies by version) where each app can be set to Unrestricted. That single toggle is the modern equivalent of “ignore optimizations” and is the first change worth making on Pixel and near-stock builds.
Generic path (Android 13–15 style)
- Open Settings → Apps → your Clash client.
- Open Battery (sometimes under App battery usage).
- Select Unrestricted / allow background activity.
- Disable any per-app Pause activity if unused style option if present.
On some devices the toggle hides under Battery → three-dot menu → Battery optimization → pick All apps → find the client → choose Don't optimize. If you see both menus, apply the stricter allowance. Reboot once after changing optimization classes so the scheduler picks up the new bucket.
Name chaos
Forks ship under different package names. Search the list by the visible app name you launch, not only “Clash,” because Meta, Mihomo, and community builds often differ.
Step 2 — Lock the task in Recents (overview)
Pinning the app in the overview screen is a low-tech signal to many Chinese OEM ROMs: “do not swipe this away.” It is not a formal API guarantee, but it reduces accidental eviction when memory pressure spikes during camera or game sessions.
- Open the Recents / overview list.
- Locate your Clash client card.
- Tap the app icon or menu and choose Lock / Keep open (translations differ).
Pair this with disabling “clear all” habits: some launchers wipe locked tasks anyway depending on vendor bugs—if disconnects track exactly to using a cleaner shortcut, retrain that muscle memory first.
Foreground service, notification, and Android 14+ expectations
Clash-style clients normally promote the tunnel to a foreground service so Android treats it as user-visible work. That path requires a persistent notification channel. If you silence or hide the category, some builds still keep the VPN up; others become more willing to pause when the user signals “I do not want ongoing alerts.” Leave at least one non-silent channel active while you are debugging disconnects.
Starting with Android 14, Google tightened foreground service types and background start rules. Well-maintained clients declare the correct foregroundServiceType for networking or special-use cases; sideloaded forks that lag behind the template may trip new restrictions and look exactly like classic battery kills. If you recently upgraded the OS and only then saw drops, check for an app update before rewriting profiles.
- Confirm the VPN notification appears when connected and does not immediately vanish when you collapse the shade.
- Avoid “notification cleaner” utilities that auto-dismiss ongoing VPN alerts—they can destabilize the service wrapper.
- If the client exposes a tile or quick-toggle, use it once after boot so the service rebinds cleanly.
Step 3 — OEM autostart, secondary permissions, and “startup manager”
Xiaomi MIUI, OPPO ColorOS, vivo Funtouch, Huawei EMUI, and similar stacks add a second layer beyond Google’s battery page. You typically need Autostart enabled, Display pop-up windows while running in background (for some builds), and exclusion from battery saver lists that throttle “unused” packages.
| Vendor hint | Where people usually find the toggles |
|---|---|
| Xiaomi / Redmi / POCO | Security → Manage apps → Autostart; also per-app Other permissions for background activity. |
| Samsung One UI | Battery → Background usage limits; put the client in Never sleeping apps and remove it from Sleeping / Deep sleeping lists. |
| OPPO / OnePlus ColorOS | Battery → App battery management → allow run in background; check Startup Manager. |
| Huawei / Honor | Battery → App launch → manual control with all switches on for the client. |
Menus move between minor OS updates—if a path is missing, use Settings search for keywords like autostart, startup, background activity, and unrestricted. The goal is always the same: the package may start at boot, run a foreground service without being paused, and not be “frozen” after a few hours of UI idle time.
Third-party “phone boost” or “RAM clean” tools deserve an explicit warning: they issue force-stop intents to anything not on their allowlist. Even perfect OEM toggles lose against a nightly cleaner that swipes Clash off memory. Uninstall or whitelist the client there first; otherwise you will chase ghosts in your proxy logs.
Step 4 — Data saver, metered Wi-Fi, and background data
Even with perfect battery classes, Android can still defer network I/O. Check three related settings:
- Data Saver (or per-app data restrictions): allow unrestricted data for the Clash client so subscription fetches are not delayed.
- Metered network flags: if your Wi-Fi is misclassified as metered, background jobs may skip.
- Private DNS in “Automatic” versus provider mode: rarely kills the VPN outright, but combined with fake-ip setups it can masquerade as a “stale sub” when resolution paths change—cross-check with the DNS and fake-ip article if HTTP works only sporadically.
Step 5 — Subscription refresh and timers after policy fixes
Remote profile URLs usually include HTTP caching headers. Your client schedules periodic downloads; when the OS delays WorkManager-style jobs or kills the process between invocations, you see long gaps in update timestamps even though the link is valid. After you exempt battery and background:
- Open the client, trigger one manual refresh to confirm reachability.
- Set a conservative update interval while testing—very aggressive polling on a starved scheduler just amplifies failure logs.
- Leave the device locked for an hour with the VPN enabled; confirm the notification persists and that a scheduled fetch actually registers.
If imports still fail with timeouts or TLS errors, switch to the Android subscription import troubleshooting guide—that page focuses on transport and clipboard issues rather than power policy.
When it is not the battery: quick triage
Power fixes help persistent disconnects; they do not rewrite broken rules. Spend five minutes ruling out these parallel issues before you flash another ROM:
- Server-side or node instability: if disconnects happen only on certain policy groups, rotate nodes or inspect latency tests.
- Split-tunnel mistakes: verify per-app routing is not excluding the browser you test with—see the per-app routing walkthrough.
- Kernel TUN versus system proxy: some builds mix modes; ensure the tunnel interface is actually up when the UI claims “connected.”
Security and policy
Use profiles and infrastructure you are entitled to access. Aggressive background exemptions increase battery draw—apply them only to the client you trust, and revert toggles when uninstalling.
FAQ
I unrestricted battery but it still drops—now what?
Re-check OEM autostart, remove the app from “sleeping lists,” disable third-party “phone manager” cleaners, and test with always-on VPN off other competing VPN profiles. Some enterprise MDM policies override local toggles.
Overnight disconnects only
Doze deep idle is stronger when unplugged. Plug in once to confirm; if charging fixes it, combine unrestricted battery with disabling ultra power saver and confirm alarm-based refresh is not blocked.
Two Clash-like apps installed
Only one VPN service should own the tun interface. Uninstall or disable the duplicate to avoid fight-over-permission loops that look like random drops.
Work profile or second user
Enterprise work profiles duplicate battery policies. If Clash lives only in the personal profile but browsers span both, you may see split connectivity. Apply the same unrestricted background stance inside the profile that actually hosts the VPN app, or move the client to match where you test.
I am comfortable with ADB—any extra signal?
dumpsys deviceidle and dumpsys battery show doze history; adb shell cmd activity processes helps confirm whether your package is still alive after screen-off. This is optional—most readers should finish the UI toggles first.
Field checklist
- Battery usage set to Unrestricted / not optimized.
- Task locked in Recents; no habit of force-stop from Settings.
- OEM autostart and background activity allowed.
- Data saver / background data restrictions cleared for the client.
- Manual subscription refresh works; schedule tested after idle.
Keep a trustworthy client handy
Power tuning is frustrating when the underlying app is opaque. Prefer builds with readable logs, clear VPN state, and predictable update behavior—then the Android settings above actually stick.
Stable Clash on Android
Exempt battery, lock the task, allow autostart—stop surprise proxy drops and let subscriptions refresh on time.
Download Clash