How to Fix Delayed Notifications on Xiaomi with ADB and Termux (100% Working)

Xiaomi, Redmi, and POCO smartphones—particularly Chinese domestic versions (China ROMs) running MIUI or HyperOS—are widely prized for offering flagship-tier hardware at modest price points. However, the most aggravating flaw that plagues almost every imported device is the notorious "delayed notification bug". Crucial incoming messages from WhatsApp, Telegram, Messenger, Gmail, and banking apps are routinely delayed by 15 to 30 minutes, or fail to alert the user entirely until the application is manually opened. This guide provides a 100% effective fix using simple ADB commands (non-root) and Termux shell execution (rooted).
The technical root cause of notification delay on Xiaomi devices: Chinese regional ROMs feature ultra-aggressive battery management daemons (such as Xiaomi Powerkeeper). Approximately three minutes after the screen turns off, the kernel aggressively freezes background app threads and severs the Google Firebase Cloud Messaging (FCM) heartbeat socket to maximize standby battery life. Furthermore, an Android Quick Settings media resumption defect (qs_media_resumption) frequently deadlocks the notification dispatcher service.
1. Complete Optimization Checklist for MIUI & HyperOS
Achieving instant, real-time push notifications requires harmonizing system UI privileges with low-level Android settings:
| Optimization Setting | Configuration Path on Xiaomi | System Purpose |
|---|---|---|
| Autostart Permission | Settings -> Apps -> Permissions -> Autostart -> Enable for Messaging Apps | Permits apps to revive background message services after RAM cleanup |
| Battery Saver Profile | App Info -> Battery Saver -> Set to No Restrictions | Prevents the OS from terminating background push listeners during sleep |
| Lock in Recents Menu | Long-press app card in recent tasks overview -> Tap Padlock Icon | Protects vital messaging processes from accidental system clearing |
| Disable Media Resumption | Execute: settings put secure qs_media_resumption 0 |
Eliminates notification shade queue bottlenecks caused by audio players |
| Device Idle Doze Whitelist | Execute: dumpsys deviceidle whitelist +[package_name] |
Exempts Google Play Services and messaging clients from deep Doze freeze |
2. Method 1: Non-Root Fix via PC and ADB
This is the standard, manufacturer-safe approach that does not void warranties and requires no bootloader unlocking:
Step 1: Enable USB Debugging on Your Xiaomi Phone
- Navigate to Settings -> About phone.
- Tap repeatedly (7 times) on the MIUI version (or HyperOS version) until you see "You are now a developer".
- Return to Settings -> Additional settings -> Developer options.
- Enable the following toggles: USB debugging: Switch ON. Install via USB: Switch ON. USB debugging (Security settings): Switch ON (requires Mi Account login).
Step 2: Connect to PC and Execute ADB Shell Commands
- Connect your phone to the PC using a USB cable. Select "File Transfer" mode.
- On your phone screen, check "Always allow from this computer" and tap OK.
- On your computer, open a Command Prompt (cmd) window and verify the link:
adb devices - Enter the command to clear notification dispatcher bottlenecks:
adb shell settings put secure qs_media_resumption 0 - Exempt Google Play Services and common communication apps from deep Doze mode:
adb shell dumpsys deviceidle whitelist +com.google.android.gms adb shell dumpsys deviceidle whitelist +com.whatsapp adb shell dumpsys deviceidle whitelist +com.facebook.orca - Restart your smartphone to apply kernel configuration changes.
3. Method 2: Rooted Fix via Termux (No Computer Required)
If your device is rooted with Magisk or KernelSU, you can apply the fix on-device within seconds:
- Open the Termux terminal app (download from F-Droid or GitHub).
- Request superuser access:
su - When the Magisk/KernelSU prompt appears, tap Grant.
- Run the shell configuration command directly:
settings put secure qs_media_resumption 0 - Type
exittwice to safely close the terminal. - Reboot your phone.
4. Critical Lockscreen Notification Configuration
Verify Lock Screen Visibility: Navigate to Settings -> Notifications & Control center -> Lock screen. Ensure essential communication apps are set to "Show all notifications and contents". If notifications are hidden on the lock screen, MIUI will frequently batch them together, delaying alerts until the phone is actively unlocked.
5. Frequently Asked Questions
Does disabling "qs_media_resumption" impact music playback?
Not at all. This setting solely disables persistent media player controls from sticking inside the notification tray after you have closed an audio app (such as Spotify or YouTube Music). Active audio playback widgets continue to function normally.
Do I have to re-apply this command after an OTA system update?
Values written to the Android Secure Settings Provider generally persist across minor security patches. However, if you perform a major OS migration (such as upgrading from MIUI 14 to HyperOS) or execute a factory reset, you should re-run the ADB command to ensure ongoing instant delivery.
How can I verify that the setting was correctly written?
Run adb shell settings get secure qs_media_resumption in your terminal. If the output returns 0, the optimization is active.
Related Articles

BrotX Optimizer v7: Rootless Android System Tuning via Shizuku ADB
Guide to rootless Android system tuning with BrotX Optimizer v7 via Shizuku ADB: enable ANGLE Vulkan GPU, 0ms floating window touch, 80% charge protection, and 58 flags.

iOS Debloat Script: Optimize Performance, Battery Life and Gaming FPS on Jailbroken iPhone
Complete guide to perf.sh iOS debloat script disabling 100+ telemetry and background daemons to reclaim RAM, eliminate thermal throttling, and boost gaming FPS.

OOptimize: Android 7-15 Gaming Tweaks (Root & No-Root)
Optimize SurfaceFlinger and GPU Vulkan pipeline on Android 7-15 with OOptimize: stabilize FPS, eliminate frame drops, and minimize touch input latency.

RAM Purger: Stop Background Processes & Boost Android Gaming Like iPhone
Complete guide to the rootless RAM Purger (frozen.sh) shell script terminating 400+ background app tasks to reclaim RAM and eliminate frame drops on Android.
Comments(4)
Sign in to join the conversation
Sign in with Google, Facebook or Email to leave a comment and get notified of replies.
van khong duoc huhuhu
Nó hiện thế này : No su program found on this device. Termux does not supply tools for rooting, see e.g. http://www.androidcentral.com/root for information about rooting Android. Vậy phải lm sao trong khi máy vẫn đang root ( đoạn nhập lệnh su)