Saturday, January 23, 2016

Fighting Nexus 6 for battery life

Ever since I got this phone, I've been struggling with its inconsistent battery drain. The phone may stay cool for a while but then suddenly become hot with a sharp battery drop. This happened while it was left on a steady table or in my pocket while browsing in a local store.

No surprise, the top battery drain was Google Services, they kept the phone awake all the time:


So I installed Wakelock Detector (don't install it as a system app!) to see what was going on and it obviously had something to do with Checkin, SystemUpdateService and Eventlog:


I cannot simply disable Google Services because I rely on GCM for GMail and GoogleVoice sync, so I had to do the following things to deal with it.

(Re)move some built-in apps

The /system folder has 0 space left out of box. So first thing first is to remove or move out some stuff from this folder to free up some space for system-level hacks. Other than removing, I moved these apps to /data/local, then I can move them back just in case the phone won't start up (in TWRP with its file manager):

/system/app: Books, Chrome, CloudPrint2, Drive, EditorsDocs, EditorsSheets, EditorsSlides, FitnessPrebuilt, GoogleContactsSyncAdapter, GoogleEars, Hangouts, Music2, Newsstand, PlayGames, PlusOne, PrebuiltKeep, PrebuiltNewsWeather, talkback, Videos

/system/priv-app: CallLogBackup, GCS, GoogleBackupTransport, GoogleFeedback, GoogleOneTimeInitializer, MusicFX, SetupWizard

Don't move those that you do need, for example, Drive or GCS, if you do need Google Drive for cloud storage or Project Fi for voice/data service.

Needless to say, without these garbage, the phone becomes more responsive and cooler with less battery drain.

Autostarts

I installed this app from F-Droid, search for Checkin, Eventlog and SystemUpdateService, respectively, and disabled all the occurrences:


Right after done this, Google Services no longer appear in the top battery drain list! With such a great success, I went further and disabled unnecessary intents and receivers for other apps such as YouTube etc. For example, players like Tunein and TV Plus do not need to be started automatically after a reboot nor react to network changes, but do need to react to headphone buttons and widget clicks:


Greenify

Now these apps no longer starts by themselves, but after we, say, watched TV, we still want them to be closed. This is what Greenify comes handy.


Xposed

In Wakelock Detector, I noticed that WeChat generated too much wakelocks. There are several apps can block wakelock request from an app, such as No Wakelock and Advanced Permission Manager. They are very straightforward to use. However, they cannot block some wakelocks by unknown system processes. I need to deal with such system wakelocks, so I installed Xposed. The ones for Nexus 6 6.0.1 are "XposedInstaller_3.0_alpha4.apk" and "xposed-v79-sdk23-arm.zip".

Per App Hacking

I use it to block wakelocks from WeChat and other apps. Yes, WeChat still works fine without delaying outbound and inbound messages. I also prevented YouTube from service.


Amplify

In Wakelock Detector, I also noticed some horrible wakelocks from unknown system processes, such as *net_scheduler*. This crap may show up anytime, even at midnight. Yes, I already greenified YouTube but Google Play Service will still launch it at anytime it wants:


While listen to music, online or offline, AudioMix and AudioOffload keep my phone staying awake:


I use Amplify to block them all (except *net_scheduler*), plus ConnectivityService that runs my phone hot whenever network status changes (e.g. between 3G and 4G), by allowing them every 9999999 seconds:


Now the phone runs totally cool without being awakened and drained by crappy google services while playing my music and keeping voice calls (Sipdroid), GMail, GoogleVoice and WeChat messages pushed in in time. The phone almost never go out of deep sleep (only 2% awake) with only 2% battery drop overnight, which is a phone ought to be in the first place:




In summery: Google added way too much garbage into this Nexus phone that's supposed to be pure and clean without garbage from carriers and manufacturers. The phone can drain battery at a fast rate at anytime even at midnight. Just Greenify alone is not enough, we must use Wakelock Detector to find out those unwanted activities and block them with Autostarts, Per App Hacking and Amplify. Don't simply disable any service, it does nothing but causing unwanted side effects.

As a side note, my phone runs on the latest 6.0.1 (shamu-mmb29s) and the so called doze mode does not help. Because, for doze to kick in the phone much stay steady for an hour and Google Play Service is one of the two apps that are excluded from doze restrictions.

Related articles:
Nexus 6 case mod
This is phone cases ought to be
Tweaks for nexus 6
Free ringplus, what's the catch?

No comments:

Post a Comment