[Nexus 4 Q&A, Help & Troubleshooting] muzzl3:
Some time ago my phone started playing up - I would feel it vibrate in my pocket and would pull it out to check the notification... It was being shut down.

A few weeks went by an this would happen occasionally, then one day after a random shutdown the phone would shut down immediately after booting into the system. Well things has gotten worse, and now these shut down events are frequent and for the last few days my phone has been useless. Like this: http://www.youtube.com/watch?v=LzNO_VVC3zg

When this all started I was on a mainstream custom 4.2.2, and having thought maybe this would be fixed in another ROM I have tried another mainstream custom 4.2.2, 4.3, and Stock 4.2.2 and 4.3 (relocked,fully wiped). Alas my issues were not going away so I had to try fix this, so I tried another battery - no good.

No matter the random shut downs, I had a stable recovery/fastboot to reflash, and the phone was charging when powered off.

So during one of these small periods of time when my phone was stable I set up ADB and started up Logcat Reader. After two crashes and again trying both batteries I had some logs...

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 7 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 6 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 5 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 4 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 3 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 2 at 79.0 degC

D/ThermalDaemon(182): Sensor 'batt_therm' - alarm raised 1 at 79.0 degC

D/ThermalDaemon(182): ACTION: CPU - Setting CPU[0] to 1188000

D/ThermalDaemon(182): ACTION: CPU - Setting CPU[1] to 1188000

D/ThermalDaemon(182): ACTION: CPU - Setting CPU[2] to 1188000

D/ThermalDaemon(182): ACTION: CPU - Setting CPU[3] to 1188000

D/ThermalDaemon(182): ACTION: LCD - Setting max LCD brightness to 181

D/ThermalDaemon(182): ACTION: BATTERY - Setting battery charging mitigation to 3

I/ActivityManager(515): START u0 {act=android.intent.action.ACTION_REQUEST_SHUTDOWN flg=0x10000000 cmp=android/com.android.server.ShutdownActivity (has extras)} from pid 515

This being my first look at these things, I look through each of the logs and see what looks like normal battery temperatures (hovering between 30 and 40 degC), but at some seemingly random time we have a 79.0 degC battery and subsequent shutdown.

I have extracted out of \system\etc\ on a few of these ROMs and ThermalDaemon appears to be doing as expected.

[batt_therm]

sampling 5000

thresholds 360 370 380 390 410 420 450

thresholds_clr 350 360 370 380 400 410 440

actions cpu+gpu+lcd+battery cpu+gpu+lcd+battery cpu+gpu+lcd+battery cpu+gpu+lcd+battery cpu+gpu+lcd+battery cpu+gpu+lcd+battery cpu+gpu+lcd+battery

action_info 1512000+400000000+240+0 1296000+325000000+215+0 1296000+325000000+192+0 1188000+200000000+181+1 1188000+200000000+181+1 1188000+200000000+181+2 1188000+200000000+181+3

At 79.0 degC the values should be set to 1188000,200000000,181 and 3.

So - why 79.0degC if the battery is not hot (faulty batteries? faulty power management IC? some other bug?), and what is the affect of 'setting battery charging mitigation to 3' and what calls the ACTION_REQUEST_SHUTDOWN?

Obviously I have no chance to RMA, but would be happy to resurrect this phone some how.