[Galaxy S II Themes and Apps] uskr:
After updating to XWKE2, some people reported their battery life greatly improved after doing a full factory reset on the device.

After some research I found out that all you have to do is delete the following files, if they exist on your system:

/data/data/com.android.providers.telephony/databases/nwk_info.db

/system/csc/nwk_info.db

(The second file may or may not exist.)

And reboot your phone. You will notice that FastDormancy will now do short pauses between queries on your logcat (5seconds or more), instead of query non-stop like crazy.

Better yet, if you have the skills, you can figure out which values to set on those databases to make FastDormancy work or disable it on networks that Dormancy is not supported.

Since there are hundreds of different networks out there, it would be impossible for me to figure out the configuration for each one of them, so for now just delete the file and you will already get a great improvement on your battery life.

If you want to know more about the FastDormancy problem, just search on this forum. There are a few threads that already discuss it in length.

Even better, here is how to set the FastDormancy pooling to a very high value, making it save even more battery when your network does not support Dormancy:

You will need to have the file /data/data/com.android.providers.telephony/databases/nwk_info.db on it's original location, so if you deleted, recover your backup copy back in place. If you dont have one anymore, you can download the attached file.

1. make sure the file /data/data/com.android.providers.telephony/databases/nwk_info.db exists

2. make sure you have sqlite3 binary installed (most people install it anyway while rooting). It's usually located at /system/xbin/sqlite3

3. open adb shell as root and execute:

# cd /data/data/com.android.providers.telephony/databases/

# getprop gsm.operator.numeric

310410 <-- write down this number, it's your carrier number and you will need it for the following commands

# sqlite3 nwk_info.db

sqlite> delete from dormpolicy where plmn="310410"; (replace the number 310410 on all commands with the number you got from the previous command)

sqlite> delete from nwkinfo where plmn="310410";

sqlite> insert into dormpolicy values("310410","My Carrier",30,30);

sqlite> insert into nwkinfo values("310410", "My Carrier", "off", 1500, "", "");

sqlite> (hit ctrl-d to exit sqlite3)

#

Done, FastDormancy will only pop on your adb logcat once every 30 seconds. you can change the number to whatever you want, in seconds.

Quick FAQ:

Q: But I don't have the second file?

A: That's fine, most people won't have it. But the code that checks for those files also checks for that one, so just in case I decided to make sure that one is deleted if ever exists.

Q: But that file may have more important network information?!

A: IT DOESN'T. If you take the time to open the file and look at it, you will se that it doesn't have much information at all. You will see it's ONLY contents are related to Dormancy, and NOTHING else. So if you are having FastDormancy problems, they already miss the information you need about your carrier anyway. Also, if you factory reset after KE2, it already delete those files.

Q: My battery usage seams the same!?

A: The problem only appears IF wifi is turned off or in "sleep mode". If you are testing it in those conditions, you won't see anything changed. You will only notice the fix while the phone has no wifi connectivity, has 3g on and is on standby. That's when FastDormancy goes nuts.

Q: How do I disable Dormancy?

A: If you wanna mess with the database or with ro.ril.disable.fd.plmn.prefix=23402,23410,23411, you can find your current network plmn running over adb shell the command: getprop gsm.operator.numeric . It's not guaranteed that it will turn it off. But if you have any luck, post here please. :)

Q: Why FastDormancy is there in the first place?

A: If your network support Dormancy AND the information required is on those databases, you can get a much improved battery life by using it. But only a few have that right now. Or at least working as intended.