Selective traffic control and notification pausing for Android devices over ADB to prevent background cellular bandwidth exhaustion while keeping Wi-Fi hotspot active and preserving high-priority notifications (WhatsApp, Instagram, Telegram).
Android's system Data Saver (cmd netpolicy set restrict-background true) disables Wi-Fi Hotspot (SoftApManager) because the operating system treats global background data restrictions and hotspot client routing as mutually exclusive.
If you turn on your mobile hotspot for a laptop, non-essential apps (Amazon, Flipkart, Myntra, Ajio, Meesho, Blinkit, Zepto, Swiggy, Zomato) continue running in the background. They download high-resolution marketing banners, rich push notifications, and tracking analytics. This drains cellular data and throttles hotspot bandwidth.
This guide provides automated scripts in Bash and Fish shell to:
- Silence and suppress non-essential retail and delivery notifications (
POST_NOTIFICATION ignore). - Halt arbitrary background tasks and broadcast wakeups (
RUN_ANY_IN_BACKGROUND ignore). - Blacklist specific app UIDs from background cellular data (
netpolicy add restrict-background-blacklist <UID>). - Keep WhatsApp, Instagram direct messages, Telegram, and incoming VoIP calls active in real time.
- Verify that Wi-Fi hotspot hardware offload remains enabled (
tether_offload_disabled 0).
For the complete architectural evaluation and benchmarking analysis, see the research paper:
papers/cellular-data-hotspot-optimization.md.
Two scripts are available under android/scripts/:
manage-shopping-traffic.sh(POSIX/Bash)manage-shopping-traffic.fish(Fish shell)
- Amazon India (
in.amazon.mShop.android.shopping) - Flipkart (
com.flipkart.android) - Myntra (
com.myntra.android) - Ajio (
com.ril.ajio) - Meesho (
com.meesho.supply) - Blinkit (
com.grofers.customerapp) - Zepto (
com.zeptoconsumerapp) - Swiggy (
in.swiggy.android) - Zomato (
com.application.zomato)
- WhatsApp (
com.whatsapp) - Instagram (
com.instagram.android) - Telegram (
org.telegram.messenger) - Google Play Services (
com.google.android.gmsfor FCM push delivery)
- Enable Developer Options and USB Debugging on your Android device.
- Connect your device via USB or Wireless ADB:
adb devices
cd android/scripts
# Restrict non-essential apps and protect hotspot
./manage-shopping-traffic.sh pause
# Inspect current AppOps restriction status
./manage-shopping-traffic.sh status
# Lift all restrictions when done
./manage-shopping-traffic.sh resumecd android/scripts
# Restrict non-essential apps and protect hotspot
./manage-shopping-traffic.fish pause
# Inspect current AppOps restriction status
./manage-shopping-traffic.fish status
# Lift all restrictions when done
./manage-shopping-traffic.fish resumeIf running commands individually:
adb shell cmd appops set in.amazon.mShop.android.shopping POST_NOTIFICATION ignoreadb shell cmd appops set in.amazon.mShop.android.shopping RUN_ANY_IN_BACKGROUND ignore# Lookup UID
UID=$(adb shell cmd package list packages -U in.amazon.mShop.android.shopping | sed -n 's/.*uid:\([0-9]*\).*/\1/p')
# Add to blacklist
adb shell cmd netpolicy add restrict-background-blacklist $UIDadb shell settings put global tether_offload_disabled 0
adb shell settings put global tether_dun_required 0- Verify blacklisted UIDs:
adb shell cmd netpolicy list restrict-background-blacklist
- Verify active hotspot traffic:
adb shell dumpsys netstats detail
- Open WhatsApp or send an Instagram DM: receipt remains instantaneous via FCM high-priority sockets, while retail promotional traffic is halted.