Repository navigation
Description
Describe the problem
On a Huawei Mate70 Pro (PLR-AL50, Android 12 based), QQ Mail receives mail through Huawei Push (com.huawei.android.pushagent). With Throne 2.1.1 as the VPN client, mail arrives instantly while the screen is on, but with the screen off it only arrives after the screen is turned on again. With Husi as the VPN client on the same device, mail arrives instantly in both states.
Logcat captures show the difference: Huawei's power management (PG) freezes Throne a few seconds after screen off and restricts its network, so push traffic through the TUN cannot be forwarded until the device wakes. In the Husi capture, PG instead delays hibernation because the VPN has data transmitting, and the notification is posted while the screen is still off.
Evidence
Throne capture (2026-12-05, local time):
10:39:31.858 PowerManagerService: Going to sleep due to power_button
10:39:36.940 PG_ash: Application com.nb4a.throne screen off ignore vpn!
10:39:36.946 SWAP_Scene: EventType:FREEZE pkg:com.nb4a.throne uid:10696
10:39:36.949 PG_ash: cSockets >> com.nb4a.throne, uids : [10696]
10:39:37.952 PG_ash: NetworkRestrict >> com.nb4a.throne, uids : [10696]
10:39:55.664 PowerManagerService: Waking up ... reason=WAKE_REASON_POWER_BUTTON
10:39:56.780 PG_ash: CancelNetworkRestrict >> com.nb4a.throne
10:39:58.568 NotificationService: enqueueNotificationInternal: pkg=com.tencent.androidqqmail
Husi capture (same device, same settings):
10:44:22.028 PowerManagerService: Going to sleep due to power_button
10:44:25.638 PG_ash: treat as downloading app for vnp, pkg: fr.husi
10:44:25.638 ash_dd: fr.husi has data transmitting, delay to H!
10:44:30.885 NotificationService: enqueueNotificationInternal: pkg=com.tencent.androidqqmail
10:44:31.159 PowerManagerService: Waking up ... details=huawei.notification:TURN_ON
Settings state
The captures also confirm that the usual background restrictions are already lifted for Throne:
dumpsys deviceidlelistscom.nb4a.throneunder "Whitelist user apps", and its uid 10696 appears in the power whitelist, so battery optimization is off for Throne.- PG log lines classify Throne as a "never opt" app.
cmd appops get com.nb4a.thronereportsRUN_IN_BACKGROUND: allow,RUN_ANY_IN_BACKGROUND: allow,START_FOREGROUND: allow (running)andACTIVATE_VPN: allow.- "Allow apps to bypass VPN" is off in both Throne and Husi, and QQ Mail / push related traffic is routed
directin both. - Setting Throne's standby bucket to
activeand allowing the background appops did not change the result: a retest capture still showsscreen off ignore vpn, FREEZE and NetworkRestrict about 4 seconds after screen off, with the notification only after wake.
Expected behavior
While the VPN is running, Throne's process should stay active enough that Huawei PG does not freeze it and restrict its network seconds after screen off, so push delivery stays instant with the screen off as it does with Husi, without needing per-app bypass for push apps.
Related
MatsuriDayo/NekoBoxForAndroid#898 describes older versions not working in the background after locking the screen, with notifications not arriving; a WakeLock kept it working there at high battery cost.
Activity