[OnePlus 3 Guides, News, & Discussion] kentexcitebot:
I've been seeing constant complaints around the OnePlus 3's development section of the forums regarding an unusual high CPU usage and massive battery drain on different ROMs. These reports are posted in the custom kernels thread.

flar2's ElementalX kernel thread (now locked unlocked):

[link removed]

eng.stk's blu_spark kernel thread:

[link removed]

The reports mostly state that "(insert kernel name) gives high CPU usage, battery drain, etc." flar2 and eng.stk both say it's not the kernel, yet every custom ROM seems to have issues with this strange "bug". Even stranger, it only affects some users.

So what gives?

To preface, I'll be as verbose as I can about my experience with this: I had this exact issue with the CPU nearly maxing out and massive battery drains on LOS/AOSP-based ROMs. I clean-flashed Resurrection Remix, DU, Citrus, and CypherOS, and I even tried flar2's EX kernel, blu*spark, and stock kernel that ships with the ROMs; every one of them had this problem. On average, I use my phone daily, but not really heavily (I don't play games, but I either web browse, Youtube, or calling/text), so I found it odd that my phone's battery drops from 100% to 72% every time I get up in the morning and down to 15% after only 2 hours of using my phone. I thought this was strange since I never had this problem before. I checked my phone's battery stats (Settings -> Battery) and didn't find anything strange. I blamed CM/LOS and switched to AOSP, same issue. From there was a full day and half of switching ROMs, swearing, and confusion. What I should've done from the start was check the logcat because the solution was literally written all over the logcat.

Something related to the modem was silently crashing in the background.

It would restart again and again, crashing every 5-10 seconds or so. It would comment something about com.phone.android - I forgot to save a screenshot of the message

but nevertheless this error was 5-6 lines long and was scattered all over the logcat. Again, silent crash: no (processes) has stopped, unfortunately, (processes) has stopped, etc). This would explain why my device never entered deep sleep and sky-rocketed the CPU frequency.

To conclude, I firmly believe the high battery drain and CPU usage is actually caused by Oxygen OS's 4.0.x firmware, NOT THE KERNEL. When I switched to 3.2.8 firmware or 3.5.5CE my issue was completely fixed - 10 hours of SOT and very good performance using the EX kernel +AKT combo. I think the reason why some people have this problem and others don't is because they're on different firmwares. Through testing, 4.0.x has these problems whereas 3.5.5CE and 3.2.8 does not.

I want to note that I did not test stock Oxygen OS. The firmware downgrade solution may also not work for you - hence why the thread's title name is "a potential fix". Some users on FreedomOS, Experience, or other custom Oxygen-based ROMs have reported two approaches to fix battery and CPU usage:

The modem/phone errors on firmware 4.0.x could be limited to custom AOSP/LOS ROMs. Using an older firmware may cause Oxygen OS Nougat to not boot anymore, so backup everything and make sure you have a restore point before trying my fix.

TL;DR: This is NOT a kernel issue. Don't blame flar2, eng.stk, or anyone but OnePlus. I believe this is a bug in OnePlus' Nougat firmware. Until OnePlus fix this, I urge everyone to flash either 3.2.8 or 3.5.5 firmware and see if the High CPU usage and battery drains are gone on custom AOSP/LOS ROMs. You can try downgrading firmware on Oxygen OS - but please backup and make a restore point if the ROM does not boot (I did not test stock Oxygen OS). If you're on Oxygen OS, I suggest you try using phhh's root and changing SELinux Policy to permissive first (though SELinux should be enforced) before downgrading firmwares. OnePlus needs to fix their unstable firmwares (and release Camera blobs, etc)!

STEPS:

0. If you're on Oxygen OS, try phhh root and changing SELinux policy to permissive first. If that doesn't work, or if you're not on Oxygen OS, go to the next step.

1. Go to jamal's firmware/modem collection: (link removed)

2. Click the Android 6.x button.

3. Click link to download Firmware + Modem zip 3.2.8 OR 3.5.5CE (I recommend 3.2.8).

4. Flash in TWRP recovery (any recovery version works).

5. Reboot and enjoy better battery life and no high CPU usage

5a. If you set a lockscreen with PIN, chances are that you won't be able to get pass the lockscreen; in that case, reboot back to TWRP recovery, mount /system, use the built-in filemanager to navigate to /data/system, and delete the 5 gatekeeper/lockscreen files.

5b. If your ROM kernel panics after flashing firmwares (screen suddenly goes black, reboots), delete the init.d folder.

UPDATE:

I've been doing some testing with the OOS 4.0.x firmware and I think I found out the issue!

I kept getting the same battery drain on LOS/AOSP-based ROMs. Reading the thread, it seems hardly anybody has this issue on newer firmwares. At first, I thought it was an F2FS issue. I started from scratch by wiping everything (including the internal storage), changed the /data partition to ext4, and upgrading TWRP. When I booted the ROM afterwards and let my phone sit for a few hours, I still had that strange error with the CPU behaving abnormally and battery drain. So I took to the logcat and started searching.

The error that generated heat and battery drain from OOS 4.0.x's firmware is the following:

Sending non-protected broadcast com.android.imsconnection.DISCONNECTED from system 2019: com.android.phone

com.android.phone? That's familiar....remember how I said in the OP it was a modem issue? But just above the error has this message:

ImsSenderRxr : Response data: [12, 13, -1, ...

That's Enhanced 4G LTE Mode! All I needed to do was flip the switch OFF and viola! All errors gone, CPU stable and minimal battery drain. Oxygen OS does not error out like this, so I'm certain this "issue" is exclusive to just LOS/AOSP.

Looking at the OP I realize how silly this thread is. I could've just attached the logcat into the Q/A thread and asked for help, done deal. My apologies everyone. If you downgraded the firmware to try this "fix", upgrade back!

For people running Oxygen/Freedom/Experience OS: if you have drain, this fix still applies to you:

Use phh's superuser instead of SuperSU

Using the command:

su
setenforce 0

or using init.d scripts to change SELinux's policy to permissive

If /data is F2FS, try changing it to EXT4

I'm open to discussion - did this solution work for you? Anyone try this on Oxygen OS? Or perhaps you have a different solution? Comment below, or use the poll! That will help me when I create future OP threads :)