Elmord's Magic Valley

Software, lingüística e rock'n'roll. Às vezes em Português, sometimes in English.

The curious case of NFC and LineageOS battery consumption

2021-05-31 21:30 +0100. Tags: comp, android, in-english

I was experiencing short battery duration (the battery was lasting barely 1 day) on my Samsung Galaxy J3 (2016) phone running LineageOS 14.1. The battery didn’t last any longer with the original ROM, so I assumed that the battery was old and bought a new one, replacing the original 2600mAh battery with an third-party 3630mAh one. The battery duration did improve a bit, but not nearly as much as I expected it to with a new battery with larger capacity. So I decided to investigate the situation a bit better.

The webs had told that the problem was likely some application holding a wakelock, blocking the phone from sleeping. I installed an app called BetterBatteryStats, which can be found on F-Droid. This app runs in background and collects battery usage statistics from running apps; you have to let it run for a while to get useful information from it. After some 30 minutes, I looked at the Partial Wakelocks panel and saw that there was a NfcService:mRoutingWakeLock item responsible for some 22% of battery consumption.

Now, NFC is a technology used for contactless payments using the phone, and similar applications. The Galaxy J3 does not support NFC. I’m not sure why the system was wasting CPU on this; I have found other people complaining about this same issue on the same ROM and phone.

The solution is to disable NFC Service in the system. Open up adb shell, become root (su), and then run:

pm hide com.android.nfc

After you do this, the system will loop complaining that NFC Service has been stopped. Restart the phone, and the error will be gone.

After a full charge, the system battery stats now tell me the battery will last 4 days. Will it really? Only time will tell, but I can already see that the battery is draining much more slowly than before.

Comentários / Comments (2)

c.m., 2021-06-06 17:19:35 +0000 #

RemindMe! 4 days


Vítor De Araújo, 2021-06-06 17:32:04 +0000 #

@c.m.: It did last 4 days, but rather than showing a constant rate decrease, the duration estimate updated to 6 days at some point and at the fourth day it sharply dropped. I still don't know if it's a hardware problem (the battery hasn't properly calibrated yet since it's new) or a software problem (something started eating battery like crazy at some point).


Deixe um comentário / Leave a comment

Main menu

Posts recentes

Comentários recentes

Tags

em-portugues (213) comp (141) prog (69) in-english (54) life (47) unix (36) pldesign (35) lang (32) random (28) about (27) mind (25) lisp (23) mundane (22) fenius (20) web (18) ramble (17) img (13) hel (12) rant (12) scheme (10) privacy (10) freedom (8) academia (7) copyright (7) bash (7) lash (7) esperanto (7) music (7) shell (6) home (6) mestrado (6) emacs (5) android (5) conlang (5) misc (5) editor (4) book (4) worldly (4) etymology (4) latex (4) politics (4) php (4) security (3) film (3) kbd (3) wrong (3) tour-de-scheme (3) c (3) network (3) lows (2) poem (2) cook (2) physics (2) wm (2) treta (2) llvm (2) philosophy (2) comic (2) golang (1) german (1) old-chinese (1) en-esperanto (1) audio (1) x11 (1) kindle (1) translation (1) pointless (1) perl (1)

Elsewhere

Quod vide


Copyright © 2010-2021 Vítor De Araújo
O conteúdo deste blog, a menos que de outra forma especificado, pode ser utilizado segundo os termos da licença Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

Powered by Blognir.