[Samsung Galaxy S9  Questions & Answers] christopherwoods:
I have an S9 (SM-G960F), UK SIM-free unlocked, running the latest OTA Android 10, One UI 2.5, Baseband G960FXXUCFTJ1, Kernel 4.9.118-19869059, Build number QP1A.190711.020.G960FXXSCFTK2.

My network, Three UK, runs two APNs - the main one "three.co.uk" is a CG-NAT APN which almost all users use by default. There is a second APN, "3internet", primarily used by dongles but which is also available for general use.

The main benefit of "3internet" is that it assigns a publicly accessible IP address from Three's public IP pool, with no CG-NAT (dual NAT) - allowing you to directly access your device from the Internet. For example, you can run kWS Server and access content directly on the device's public IP assigned to the 3G/4G modem. A publicly accessible IP also reduces issues with SIP/VoIP services, which I use a lot.

A while back, I started noticing excessive battery drain - between 5 and 8% per hour, even in deep sleep. I tolerated it for a week or so while trying to figure out the root cause. Eventually I did full cache partition wipes and factory resets, and initially the device was fine, until I restored a backup from Samsung cloud. Suspecting a rogue app stuck in a sync loop, I factory reset again -- this time restoring just bare minimum of apps from Google Cloud. Interestingly, this did not restore the battery drain. I then went through the phone's settings and restored my usual customisations, including the second APN. I didn't immediately make it active.

The other week, I needed to use the "3internet" APN, so I made it active. I subsequently noticed that after switching to the "3internet" APN, battery usage suddenly increases to a steady amount, even when the device is in deep sleep. Whoah, a simple change of APN is causing battery drain?!

Examing Android battery usage screen and BetterBatteryStats for any indicative wakelocks, at first I thought it might be an app update causing issues. Things like WhatsApp and Instagram appeared to be using a higher than normal amount of battery while running backgrounded. However, doing a full delete-cache-delete-storage-then-uninstall to completely remove all questionable apps made no difference.

I could literally sit and watch my battery consumption steadily decrease, a straight diagonal line on the battery usage screen.

Changing my APN back to "three.co.uk" resulted in the battery consumption graph curving back to a flat line - nearly zero consumption in deep sleep, as it was before. In fact, even less than I was experiencing before (2-3% was normal, though I also uninstalled Facebook Lite and Instagram during this latest testing, which I've found can account for around 2% battery usage per hour).

I didn't even think to test switching between APNs to check for battery drain until I read some threads on xda, some on Reddit, but it was a forum thread concerning a South African telco - discussing possible kernel issues associated with different APNs and the symptom of excessive RILJ_ACK_WL wakelocks - which inspired me to try changing APNs on my device.

In my case, the phone was logging thousands of RILJ (Radio Interface Layer client-side socket) wakelocks during deep sleep. Once the APN was reverted to the 'default' APN - wakelocks decreased along with battery drain.

So far, changing the APN to "3internet" reliably causes the battery drain to resume. Changing it back to "three.co.uk" stops the excessive battery drain. I can observe this by changing the APN then letting the device deep sleep, then review the battery usage graph. It seems really counterintuitive, but the evidence speaks for itself I think.

Is this a Samsung-specific kernel issue, a Google location service issue or some other Android subsystem issue? Is it perhaps caused by some network-level incompatibility of how the mobile network has configured this specific APN, or is it simply a bug when any combination of multiple APNs is used on this device?

Has anyone else experienced this issue and been able to determine the exact reason for this scenario causing battery drain?

Further reading I gathered along the way...

Telkom confirms smartphone battery drain problems on LTE

Telkom does legit drain my battery quicker I had idle drain of 4.1% on my MTN Sim I have an idle drain of 0.38% Using Moto G5+ No Data Connection No or Unknown Signal these two had 100% usage on Telkom and 0.3% on MTN RILJ_ACK_WL Partial Walkelock Count 1093 on Telkom...

mybroadband.co.za

https://xdaforums.com/t/battery-drain-due-to-rilj-solved.1878692/

Android 4.4 RIL software framework

This paper mainly analyzes the command interaction process between Android 4.4 RIL's telephone and modem, but this paper does not focus on telephone.Telephone involves many specific business logic contents, including sim, dail, sms, network, etc., which will be studied and analyzed in the...

programming.vip

Android Radio Layer Interface

Android Radio Layer Interface - Download as a PDF or view online for free

www.slideshare.net