Skip to content
NoticeWelcome to Osteup! Practical tools and optimization tweaks shared freely.
Osteup LogoOsteup

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

oosteup
··2 min read·0 views
Fix LagAndroid
Cách Sửa Lỗi Chậm Thông Báo Trên Điện Thoại Xiaomi Bằng ADB và Termux

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

  1. Navigate to Settings -> About phone.
  2. Tap repeatedly (7 times) on the MIUI version (or HyperOS version) until you see "You are now a developer".
  3. Return to Settings -> Additional settings -> Developer options.
  4. 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

  1. Connect your phone to the PC using a USB cable. Select "File Transfer" mode.
  2. On your phone screen, check "Always allow from this computer" and tap OK.
  3. On your computer, open a Command Prompt (cmd) window and verify the link: adb devices
  4. Enter the command to clear notification dispatcher bottlenecks: adb shell settings put secure qs_media_resumption 0
  5. 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
  6. 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:

  1. Open the Termux terminal app (download from F-Droid or GitHub).
  2. Request superuser access: su
  3. When the Magisk/KernelSU prompt appears, tap Grant.
  4. Run the shell configuration command directly: settings put secure qs_media_resumption 0
  5. Type exit twice to safely close the terminal.
  6. 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.

Was this article helpful?

Related Articles

Comments(4)

Quân
Quân2/17/2024

van khong duoc huhuhu

Quân
Quân2/15/2024

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)