Root Cause Diagnosis
Android USB tethering automatically drops on a fixed interval when the host operating system’s USB Selective Suspend or Linux autosuspend power management policies put the USB hub into a low-power sleep state. Simultaneously, Android’s internal Doze mode and vendor-specific battery optimization services (e.g., Samsung Device Care, Xiaomi MIUI/HyperOS Battery Saver) classify the active tethering daemon (ipacm or rndis) as an idle background process when the phone screen turns off. This dual-sided power saving forces the USB data interface to reset, tearing down the RNDIS/NCM virtual network adapter every 10 minutes.
Quick Fix
Disable USB autosuspend on the host OS via shell command and prevent Android ADB power management from suspending the USB interface:
- On Linux Host: “`bash echo -1 | sudo tee /sys/module/usbcore/parameters/autosuspend
* **On Windows Host (PowerShell as Admin):**
```powershell
Get-NetAdapter -Physical | Where-Object {$_.InterfaceDescription -like "*NDIS*" -or $_.InterfaceDescription -like "*RNDIS*"} | Disable-NetAdapterPowerManagement
- On Android Device (via ADB): “`bash adb shell settings put global stay_on_while_plugged_in 3
---
### Step-by-Step Resolution
#### 1. Disable Host USB Selective Suspend (Windows / Linux)
* **Windows OS Configuration:**
1. Open **Device Manager** (`devmgmt.msc`).
2. Expand **Network adapters**, right-click your Android RNDIS/NCM device, and select **Properties**.
3. Navigate to the **Power Management** tab and uncheck **Allow the computer to turn off this device to save power**.
4. Expand **Universal Serial Bus controllers**, open **USB Root Hub** properties, and uncheck the same setting.
5. Open **Power Options** (`powercfg.cpl`) > **Change plan settings** > **Change advanced power settings** > **USB settings** > **USB selective suspend setting** and set it to **Disabled**.
* **Linux OS Configuration:**
Make USB autosuspend permanently disabled for Android devices by creating a Udev rule:
```bash
sudo nano /etc/udev/rules.d/50-android-usb-power.rules
Add the following rule line:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{power/control}="on"
Reload Udev rules:
sudo udevadm control --reload-rules && sudo udevadm trigger
2. Exclude Android Tethering System Services from Battery Optimization
- Open Android Settings > Apps > Special app access > Battery optimization (or Unrestricted battery usage).
- Switch filter to All apps.
- Locate Tethering (or
com.android.providers.telephony/TetheringAutomation) and set to Unrestricted / Don’t optimize.
3. Enable Developer Options for Persistent USB State
- Go to Settings > About Phone and tap Build Number 7 times.
- Open Settings > System > Developer options.
- Enable Keep screen awake while charging (Stay Awake).
- Set Default USB configuration to USB tethering.
- Enable Mobile data always active (prevents Android from cycling network interfaces when Wi-Fi/cellular state shifts).
Why This Fails for Some Users
- USB Port Hardware Power Delivery Caps: Type-A ports on older motherboards or unpowered USB hubs often drop voltage when the Android battery reaches 100% and switches from fast charge to trickle charge. The sudden voltage draw shift causes the host USB controller to cycle the port to reset current limits.
- Aggressive Vendor RAM Managers: Custom Android ROMs (such as Xiaomi HyperOS, OnePlus OxygenOS, or Huawei EMUI) run kernel-level task killers (
lmkdtweaks) that ignore standard Android battery optimization whitelist flags, terminating thetetheringprocess when the screen locks for more than 10 minutes. - Carrier APN Tethering Timer Limits: Mobile network operators enforce hard IP lease timeouts on secondary APNs (
dunAPN type). If carrier networks detect a static tethering TTL payload without active TCP keep-alive signals, the carrier gateway drops the data tunnel remotely at strict 10-minute intervals. - Faulty USB 3.0/3.1 Controller Drivers: Certain ASMedia or Realtek USB 3.0 host controllers on desktop motherboards exhibit xHCI handoff failures during prolonged steady-state data transfers. Dropping the connection down to a physical USB 2.0 port or using a USB 2.0 cable forces fallback to EHCI drivers, bypassing xHCI link power management (
LPM) glitches.