yashsingh1/xdaforums huggingface dataset:
[AT&T LG Optimus G] jonasl:
Like many others I was seeing many wakeups by com.android.phone, and as noted by others this is because of fast dormancy. Or rather, because of LG's implementation of it.

I'm not gonna go into too much detail, but the offending implementation can be found in com/android/internal/telephony/LgeFDHandlerInterfaceImpl . This class is in /system/framework/com.lge.core.jar . After data activity on HSPA networks they use AlarmManager to periodically wake up and check the number of bytes transmitted over the network interface. This goes on until some time after it stops changing, and the connection is considered dormant.

This periodic checking is what's waking the device, and for every new byte transferred the wakeup/polling period is extended and device doesn't sleep. The chattier apps are, the more awake time you'll get.

Enough of the boring details, here's how I disabled it and got rid of the com.android.phone wakeups. Root required.

$ adb shell
# su
# sqlite3 /data/data/com.android.providers.telephony/databases/telephony.db
update dcm_settings set fastdormancy="0" where numeric="310410";
.quit
# reboot

This helped me, hope it does the same for you.

Edit 2:

I've written a quick and dirty app that tries to handle this setting without need for terminals or root. Try it and report issues here: http://xdaforums.com/showthread.php?t=2021248

Edit 1:

In essence you need to change a value in a sqlite database and there are many ways to do it. There are apps, use adb shell etc. Whatever works for you. If someone wants to write an app that makes this easier, be my guest :)

Reversal is restoring the original value "1,0,0,1000,5000,60000,3000,5000,1,8" and reboot:

update dcm_settings set fastdormancy="1,0,0,1000,5000,60000,3000,5000,1,8" where numeric="310410";

This database is not there after a wipe, so future ROM chefs wanting to include it by default should edit /etc/dcm_settings.xml as this is where the initial database contents come from. Just replace the original value with "0" for ATT.

<profile>
<siminfo
operator="ATT"
country="US"
mcc="310"
mnc="410"
extraid=""
/>
<settings
fastdormancy_param="1,0,0,1000,5000,60000,3000,5000,1,8"
ipmtu="1410"
/>
</profile>
[AT&T LG Optimus G] n1mr0d:
Holy Hell!!!

so far so good...it's a shame I can only thank so much!!!
[AT&T LG Optimus G] d08speed3:
I use Comand prompt and copy these codes?
[AT&T LG Optimus G] faisalsiddiqui:
Thanks a lot for this, can you please explain how to use this code, i am rooted and am trying to run this on my computer with adb and i get a message sqlite3 not found
[AT&T LG Optimus G] Murasakiii:
I plugged my phone in as charge only and ran this code using cmd.

After the end of each line simply press enter and it prompts for the next.

When you prompt for reboot, it takes a couple of seconds, for those who get confused when their phone sits there.

Anyway, the code seems to work for me, looking forward to results.

Hope this helped.
[AT&T LG Optimus G] pfoxdizzle:
Im getting a no sqlite3 found error as well
[AT&T LG Optimus G] faisalsiddiqui:
I just used sqlite editor from the market and edited the value to "0". I can confirm that this process works, i have been struggling with this wakelock for 2 weeks now and have tried so many things but this is the only thing that has worked. Kudos to the OP!!:fingers-crossed:
[AT&T LG Optimus G] Murasakiii:
Are you both rooted and have unlocked bootloader? Not sure why you're getting errors. Did any of you retry this process via computer cmd with USB debugging?
[AT&T LG Optimus G] pfoxdizzle:
rooted yes. Unlocked no.
[AT&T LG Optimus G] Murasakiii:
Unlock. It literally takes no time.
[AT&T LG Optimus G] pfoxdizzle:
unlocking should not affect this. And there isnt anything worth unlocking for yet. So i will keep my warranty
[AT&T LG Optimus G] Murasakiii:
Warranty is kinda meh unless you're prone to breaking your phone. But everyone does things their own way.

Are you sure that you have sqlite3 on your phone and/or are you typing the code correctly in cmd? Via computer is the easiest way.
[AT&T LG Optimus G] gowings23:
Ok, I have my LGOG rooted and unlocked and been trying to run this and can't get it to take. I'm not a noob, and I've used cmd prompt plenty for other phones. I had to use it a ton for my HTC One X. For some reason I can't get it to recognize the phone. Any suggestions?
[AT&T LG Optimus G] Murasakiii:
What's the output from the cmd prompt?
[AT&T LG Optimus G] BoostedSR20:
Something not mentioned, you are in a command prompt within the folder containing these tools right?
[AT&T LG Optimus G] d08speed3:
NVM
[AT&T LG Optimus G] Yoreo:
I'm assuming this fix was properly applied on my end?
[AT&T LG Optimus G] g4m8i7:
That's what I got, too.

I think yes, that took care of it.
[AT&T LG Optimus G] arshad14:
LTE issues

I'm guessing this fix won't necessarily disable LTE when available and the phone would be able to switch back to LTE from DC-HSPA+ when it sees that LTE is available in the area?
[AT&T LG Optimus G] gowings23:
Hopefully the image is coming through on the errors I'm getting while trying this. I'm sure I'm tired and doing something stupid, I just can't figure it out.
[AT&T LG Optimus G] Snow_fox:
Any potential cons to this? Will probably do it when I get home.. Kind of crappy to have data off and still have lots of wake ups. X.x
[AT&T LG Optimus G] Yoreo:
It seems to be working. My phones battery hasn't dropped from 76% since applying this tweak. Data and wifi are enabled, and in the past if both were enabled, the battery would drain at roughly 1-2 percentage points per hour.

Thanks for posting this jonasl!
[AT&T LG Optimus G] d08speed3:
Did mines work I'm assuming?
[AT&T LG Optimus G] jamesc760:
Mine's rooted and unlocked, running nottach's .5 rom, applied the fast_dormancy mod. Still getting android system hogging the battery more than the screen time.

How to check this fixed the fast_dormancy problem?

What, if any, side effects from the fix?
[AT&T LG Optimus G] 2disbetter:
For those of you doing this through your PC's (read windows machine) you'll need ADB installed first.

There is however aneasier method to do this.

With your phone being rooted, download the android terminal emulator.

Run it.

And then type in everything after the # adb line, excluding the #s.

This will allow you to do all of this through your phone without using a computer. However be careful, the first command will grant you super user rights, which allows you to do anything. You can seriously damage files and brick your phone. Only type what is shown in the OG post, and nothing else.

Enjoy better battery life!

2d
[AT&T LG Optimus G] vwauditech:
I did it the easy/lazy way too. I didn't want to get out of bed to grab my tablet. I'm hoping to see great results tomorrow. So far I've had no wakeups but I just did it moments ago.
[AT&T LG Optimus G] d08speed3:
Anybody?
[AT&T LG Optimus G] Murasakiii:
The image did not. D:

Maybe try getting some rest and try tomorrow? Something could pop up that you didn't notice.

There's also other methods that can be used, apparently, throughout this thread.

Edit: Btw, this a perfect fix. I let my phone die after applying this fix and charged it to 44%. Let my phone drop a couple percent and let it deep sleep. It's been at 42% for the past 20 minutes. This is for anyone having doubts about this fix. Good job, jonasl!
[AT&T LG Optimus G] d08speed3:
This tweak has made a HUGE difference so far on my GF phone! I will report more about it 2mrw. Here is another easy way to do this mod and to check it's right. All you need is ROOT no need for UNLOCKED BOOTLOADER

Download SQlite Editor http://xdroidx.googlecode.com/files/SQLite%20Editor-9.apk

Go to "Dialer Storage" > databases/telephony.db>dcm_settings and on the left hand side column where the numeric value says "310410" edit the right hand side of that value to "0" REBOOT and enjoy better battery life! This phone is slowly unleashing it's power day by day! Thanks everyone for the help!!!

*I wrote this out by memory. My gf has this phone so can't get to it at the moment. Hope it works.
[AT&T LG Optimus G] matt310:
Which line are we to change from 1 to 0?
[AT&T LG Optimus G] d08speed3:
FastDormancy
[AT&T LG Optimus G] matt310:
So wipe out all those values and replace simply with a single zero?
[AT&T LG Optimus G] d08speed3:
I'm pretty sure don't have my ladies phone on hand to check. Have you tried the Command Prompt way yet? That is what I did. However, before copying all the lines one by one and pressing enter (don't include the tags in from ex. "$","#") Go to the market and download "SQLite Installer For Root" Install it and it will insall SQlite on your phone. From there run the commands. That's how I did mines
[AT&T LG Optimus G] Digil:
I tried this method and got the error "unable to open database file". Any ideas?

Also, the path is Phone/Messaging Storage > telephony.db > dcm_settings
[AT&T LG Optimus G] matt310:
I tried to install what you recommended but when the installer tried to dl the sqlite the installation failed due to a protected directory not allowing read/write access.

This method (in my screenshot) seems to be a lot easier since I'd just be clearing a cell of data and replacing it with zero but I want to make sure that's the correct approach.
[AT&T LG Optimus G] d08speed3:
You should be able to edit that line. Hmmmm

---------- Post added at 08:52 AM ---------- Previous post was at 08:51 AM ----------

The app installer failed?
[AT&T LG Optimus G] matt310:
"SQLite Installer For Root" attempts to install SQLite to the phone, which for me failed, according to the installer script....something about read/write access not being obtained for a system folder.

The app in the screenshots is SQLite Editor and allows you to select each cell and make edits to the data within. If I change 'fastdormancy' to 0 (zero) it would wipe all the data out of that cell, which is fine, if that's what needs to be done. However all other cells in fastdormancy with 0 as the value also have 0 (zero) as a value in the imptu row, so would I change that to 0 (zero) as well for id 24 (310410) ?
[AT&T LG Optimus G] lyall29:
Here is a screenshot of my phone after using adb from my laptop to run the script.
[AT&T LG Optimus G] d08speed3:
This mod so far has made battery life amamzing!!!!
[AT&T LG Optimus G] Murasakiii:
http://xdaforums.com/showthread.php?t=2020415

Can anyone shed some light for me?
[AT&T LG Optimus G] Zackhery:
Thank you very much
[AT&T LG Optimus G] vwauditech:
Its been 5 hours since unplugged this morning and Im happy to say there have been no wakeups from telephony service as before. Deep sleep is working great also. The Keep awake in Android OS still higher than Im expecting, but the batter life is much improved already. Im also not in a LTE area and I disabled LTE and Im running GSM/CDMA preferred in network seettings. At the end of lunch and Im at 87% battery.

BTW, I just used terminal emulator to run the commands. People that are having a hard time might find that easier. Obviously you will leave out the adb parts in the beginning of the OP command script. Good Luck.
[AT&T LG Optimus G] Globalrebel:
did this and no problems thus far. However, I'm no longer getting the "LTE" symbol at the bottom of my 4G systembol when downloading things or browsing. It also looks like it may be downloading slower then usual. Would this change affect this?
[AT&T LG Optimus G] matt310:
I seem to be having problems accessing web sites when coming from sleep despite having a full signal. Is anyone else experiencing this?
[AT&T LG Optimus G] whiteguypl:
Im not seeing any change, os still 40-45%.
[AT&T LG Optimus G] Murasakiii:
How is your OS only using 18%? D:

Mine is sticking around 54%.
[AT&T LG Optimus G] Zackhery:
Did you reboot after applying
[AT&T LG Optimus G] Murasakiii:
Sure did.
[AT&T LG Optimus G] matt310:
Hmm...
[AT&T LG Optimus G] d08speed3:
Question....how do we reverts fastdormacy settings to factory? Was just wondering incase random stuff starts happening. My lady said her phone wasn't sending pics but quick toggle of data fixed it. I don't know if this mod caused it tho
[AT&T LG Optimus G] Murasakiii:
It's not this mod, I sent a screenshot to my friend some time last night.

In terms of reversing the effect, I assume you would just switch the values, so set 310410 where 0.

But do not take my word for it! Strictly a guess.
[AT&T LG Optimus G] d08speed3:
Cool was just wondering. My ladies phone is getting pretty good battery life. Was unplugged @ 100% for hour and half this morning and used it to text and it only dropped 1% ill keep you guys updated 2nite with more results
[AT&T LG Optimus G] jonasl:
OP updated with information on how to revert.
[AT&T LG Optimus G] bigworm50:
Unless have installed The Base ROM you likely don't have sqlite3. So go download the installer from the play store here and run it . It may fail a couple of times before it works...It has a log tab you can check to see if it worked or not.

Then connect your phone to your PC and run the commands listed. Press enter after each line!

---------- Post added at 03:20 PM ---------- Previous post was at 03:17 PM ----------

You have to have your command prompt open in a directory which has adb.exe on your computer...also see my previous post about installing sqlite3
[AT&T LG Optimus G] dbgeek:
I get "sqlite3 not found". I don't find sqlite3 on my device and I don't find anything by that explicit name in android market. Suggestions?

EDIT: never mind. I see the solution posted 1 comment before this one.
[AT&T LG Optimus G] jonasl:
Try aShell and aSQLiteManager (need both). I'm sure there are others. Sorry for not being more helpful, I'm not good at making user friendly stuff, I like to dig in deep under the hood of things :)
[AT&T LG Optimus G] argolfermd:
To reverse it you would use this update command:

update dcm_settings set fastdormancy="1,0,0,1000,5000,60000,3000,5000,1,8" where numeric="310410";
[AT&T LG Optimus G] dbgeek:
I assume that should be "aSQLiteManager"?

---------- Post added at 05:01 PM ---------- Previous post was at 04:46 PM ----------

Installing sqlite3 using Sqlite Installer for Root (per bigworm50's instructions) worked like a charm when using jonasl's suggestion to use a terminal emulator on the phone.
[AT&T LG Optimus G] jonasl:
Yes, I apparently got fat fingers...
[AT&T LG Optimus G] Yoreo:
This phone is getting some beastly battery power now!

I have FreeGee v0.5

The Base v0.5

This fast dormancy tweak.

Also running eco mode, and brightness at 33%.

I've listened to google music for about 4 hours today, sent several texts, gamed for about a half hour. The on screen time is at 1.5 hours, and the battery level was at 76% yesterday when I applied this tweak last night. The slight bump in power in the usage meter came from when my cell was attached to my PC.
[AT&T LG Optimus G] drwario:
I'm doing well after this little trick

the best phone ever
[AT&T LG Optimus G] drwario:
I have a sleepy little phone

the best phone ever
[AT&T LG Optimus G] vwauditech:
Can some of you that have done the fast dormancy edit please check your Android OS usage after a full day. I have no more wakeups from telephony, but my usage is still high in my opinion. Others are posting much lower Android OS usage than I am seeing. I would really like to find what is still causing high keep awake.

Thanks
[AT&T LG Optimus G] Murasakiii:
I'm right there with you. :/ no one seems to have an answer yet.
[AT&T LG Optimus G] drwario:
Here

the best phone ever
[AT&T LG Optimus G] drwario:
Could it be that our new screen is so low consumption that the os is over exaggerated

the best phone ever
[AT&T LG Optimus G] drwario:
I'm doing really good. I'm a contractor and use my map app alot and quite a bit of calling. Much better than my ion. Vivid. Inspire. I don't have much problem in battery department

the best phone ever
[AT&T LG Optimus G] drwario:
I'm at 50% in almost 12 hours

the best phone ever
[AT&T LG Optimus G] Murasakiii:
But how is your battery life? Does your phone have random wakes or drain with moderate use? I've been off work for an hour and there's been a drain of twenty percent just due to texting and xda app.

Edit: just saw your posts. Please do the thread a favor and don't spam it. Double posting is already bad enough. No offense.
[AT&T LG Optimus G] enforcedbyalligator:
Could you please clarify what "enable" and "disable" do in the application? I've installed the app on my Bell Optimus G (E973) and the app seems to suggest that it worked. I'll report back with any improvements later.
[AT&T LG Optimus G] sheek360:
Can the sprint version benefit from this
[AT&T LG Optimus G] drwario:
the best phone ever
[AT&T LG Optimus G] Murasakiii:
What...? I wasn't talking about being on several threads. I'm talking about posting three times in a row on just one thread.

Edit your posts, don't create several new responses.

Like this:

Edit: I'm aware its a well known issue and I applied the fix yesterday and its not any better. Even a few others are having troubles post fix. So how exactly is it easily fixed? Thanks.
[AT&T LG Optimus G] drwario:
Thanks for not getting all tripped out. Easily fixed by using the fast dormancy. Freezing or removing your apps that wake the os too much. Set eco mode on. Screen at 60% Max. Set CPU conservative. Underclock to 1100 MHz. Stuff like that. Oh and the fast dormancy set to 0 thingy. You will get results like these. I'm up almost 14.5 hours at 40 % moderate heavy use at times. My os awake is about inline with what I am actually using. For me problem solved.

the best phone ever
[AT&T LG Optimus G] Murasakiii:
I've already fixed fasrdormancy. Last night. Its set to 0 as suggested and my phone still drains.
[AT&T LG Optimus G] drwario:
What about other things

the best phone ever
[AT&T LG Optimus G] Murasakiii:
To my knowledge, nothing else is waking up the battery. As I've said before, massive drain when I'm actually using the phone, such as texting and using the xda app. I've hardly used it at all today and it died not too long ago.
[AT&T LG Optimus G] Kiserai:
It sounds like you might have a bad phone. I've done nothing other than installing the base ROM and applying this fast dormancy fix. Granted, I used the app version in the Original Android Development section to make it super foolproof but it still worked. I run at 60% brightness, never use eco mode and I never use an auto task killer. I've noticed a huge improvement since installing this fix.

Maybe try running the app just to make 100% sure that it's applying the fix correctly. If that doesn't work maybe try exchanging your phone.
[AT&T LG Optimus G] DeathmonkeyGTX:
Plus one to above poster. Swap your device out.
[AT&T LG Optimus G] Murasakiii:
Well that sucks. What about the others with the same issue? I'm not alone on it or anything, I have a thread in the q&a section.

I downloaded the app last night for the fix. When I opened it it said I was already disabled. But I enabled, restarted, disabled, and restarted again. So we'll see.
[AT&T LG Optimus G] whiteguypl:
One thing we have to remember is we basically got the first batch of these phones. There are bound to be some unfixable problems for some. Im giving mine a day or two more then im going to swap it out at the store.
[AT&T LG Optimus G] Kiserai:
One other thing you can try if you're not in an LTE area is the fix here:

http://xdaforums.com/showthread.php?p=33826576

Edit your build.prop so you can enable the Network Mode selector in System Settings > Networks > Connectivity > Mobile Networks. Change it to GSM/WCDMA preferred, reboot and see if that helps. Good luck!

Back on topic, seeing a dramatic improvement in my overall drain of my device. I used to be losing around 4-5% an hour while it was in my pocket, but now it's closer to 1% every hour and a half. Been off the charger now for 5.5 hours and I'm still at 89% with about 36 minutes of on-screen time (web browsing and texting) so far this morning. Ecstatic!
[AT&T LG Optimus G] Murasakiii:
I'm technically in an LTE area. My apartment is outside of it but if I walk 2 minutes down the road, I suddenly have LTE.

The drain isn't atrocious today, but I'm definitely still losing battery when I'm doing nothing.

I checked my wakelocks and I've had ~1200 in just Android System alone since a few hours ago and I've hardly used it. Unplugged ~8:30 AM, 70% at 12:30PM.

Anything else? :/
[AT&T LG Optimus G] d08speed3:
Ima try this 4G LTE since there's is none in my area!!!! My ladies battery life has been awesome. And we took her phone back after 2 days. I rooted and all and it was draining 40% overnight! We got a new one and rooted and did fast dormancy trick and has been working great! Now to this this tweak now!
[AT&T LG Optimus G] d08speed3:
So everytime I switch the network and reboot it goes back to default?
[AT&T LG Optimus G] vwauditech:
Is annoying for sure. I'm still trying to find a way to set it permanently.
[AT&T LG Optimus G] arshad14:
Just did the wake lock on my Telus Optimus G and I still see a massive battery drain from android. I think when it's using both HSPA+ and LTE, the trick doesn't work. Maybe it has something to do with it.
[AT&T LG Optimus G] Kiserai:
My Android OS is still at 47% of my battery use, but I'm getting battery life like this...

Just because it's more than everything else doesn't mean it's using THAT much battery. Granted, I haven't used my phone a ton today but this is good now matter how you look at it.
[AT&T LG Optimus G] Murasakiii:
High percentage or not, I don't get that kind of battery life. And I do like to use my phone.
[AT&T LG Optimus G] JohnCorleone:
I recall the Nexus S and NS4G having a reporting error on this same thing. Anyhow, here's what I have. I am in a LTE area all around home just not at home. I need to focus on this device a bit more and sell a few of my other ones because I love it. I am going to sign out of G+ and GTalk and get rid of a few apps and see what happens next cycle. The 17 hours idle impressed me even though OS was through the roof

Sent from my LG-E970 using Xparent ICS Tapatalk 2
[AT&T LG Optimus G] brunes:
So I have the E973 and this app does not seem to do anything... toggled on or off, BBS is still showing this Alarm going off hundreds of times in a span of a few minutes.

Going to try the command line method next.

EDIT: Did it by command line and rebooted, and it still shows the Alarm going off all the time. Toggling this value on or off seems to do nothing.

EDIT 2 : Ah ha - the problem, I bet, is your instructions (and the app) are keyed specifically to the ATT MNC, where as I am on the Bell MNC (302610). You should update your instructions to reflect that peoople should change whatever column matches their provider.... and maybe change your app so you can pick your own. I am going to try this now.

EDIT 3: yep, this worked now!
[AT&T LG Optimus G] Mramos860:
ATT O.G. Installed The Apk

The Battery Life Has Improved A Little Bit. I'm Getting About An Hour More In Battery Life Because It Isnt Draining So Quick While Asleep. I Hope LG Releases A Software Update To Fix This Because My O.S. Is Still Consuming over 55% of power while my screen is using barely 20%.
[AT&T LG Optimus G] g4m8i7:
This is annoying. I applied the fix and it worked swimmingly. Close to 17 hours with about 3 hours screen time. Did that for two days and then back to thousands of hsic wake locks. I've checked and this is still set to 0. No changes, just back to bad battery.

I'm guessing it has to do with the LG firmware and once we get on AOSP we'll be golden.
[AT&T LG Optimus G] Brow71189:
This trick also did it for me! Thank you for mentioning that you have to change the MNC to the one of your country/provider.

Because it didnt work for me via command prompt, i used "aSQLiteManager" (from Play Store) to edit the database.
[AT&T LG Optimus G] arshad14:
For those on their consecutive operators who are wondering which values to change according to the instructions, here are your operator MNC.

Canada

TELUS/Koodo: 302220

BELL: 302610

Rogers: 302720

Fido: 302370

MTS: 302380

Sasktel: 302780

Mobilicity: 302320

WIND: 302490

ICE Wireless: 302620

Videotron: 302500 & 302510

FIRST: 302350

EastLink: 302270

And the rest are here: MNC Codes