yashsingh1/xdaforums huggingface dataset:
[AT&T Samsung Galaxy S II SGH-I777] stone_ship:
BetterBatteryStats -- Wifi Scan ?

Just got my SGS2 last week. It's not my first Android phone, so I'm generally familiar with checking on battery and CPU usage and such.

I'm running the latest UnNamed with Entropy's kernel and have been happy with battery drain on standby. Usually I am always connected to WiFi at home, so last night, I did an experiment to check battery drain while on mobile data. Off a full charge, with Wifi OFF, I got 3% battery drain overnight (7 hrs), which is very good IMO.

Checking BetterBatteryStats this morning, I noticed that something called 'Wifi Scan' was on 100% of the time. Anybody have any insight as to what this is; considering the fact that the Wifi radio was disabled? Again, I'm happy with the drain, so I'm asking mostly out of curiosity.

EDIT: aw crap, it seems my issue was just a bug with the app. Sorry for cluttering things up, I should have looked more.

Bug report here:

https://github.com/asksven/BetterBatteryStats/issues/54
[AT&T Samsung Galaxy S II SGH-I777] rlarsen462:
Well my phone was mostly sorted, but can anyone using K-9 mail tell me why the heck I get an hour per day of wakelocks when the stupid thing is only set to poll once every 2 hours? Seems like a ridiculous amount of wakelocks if the thing isn't on push or something. Nothing seems to fix it settings wise, even if I turn off every polling and push related item. Reboot the phone, nothing. Does K-9 just do this? I would have thought I would see more complaints about it if so...
[AT&T Samsung Galaxy S II SGH-I777] LimpyShox:
Even with my Facebook widget disabled, the app constantly uses CPU in the background (.5-10%). Any idea how to fix this? I have sync disabled already, and this is pissing me off.
[AT&T Samsung Galaxy S II SGH-I777] kipliq:
How would I disable apps some will not let me uninstall or disable?
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
This thread is awesome, thanks for posting this as a point of reference.
[AT&T Samsung Galaxy S II SGH-I777] MWilkenson:
Anyone know anything about network-location-cell-update...massive wakelock problem

Galaxy S2 -UnNamed-
[AT&T Samsung Galaxy S II SGH-I777] Adelaide.:
Freeze them with Titanium Backup.
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
I've been having battery problems lately so I decided to charge to 100% and leave unplugged over night. When I woke up and checked the phone 7 hours later, it was at 84% (2.2% per hour untouched).

I have Wifi Sleep setting to "when screen turns off"

Here's the BBS dump, wakelocks via ADB and other info below.

Deep Sleep = 83%

Wifi Scan = 6h 57m (100%)

Wifi Locked = 6h 57m (100%)

Awake = 1h 9m (16.6%)

Screen On = 2m 35s (6%)

Is this what I should expect battery wise?

I will add that I'm running UnNamed 1.3.1
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I am in the exact same boat as you...I had 68% before bed and I would have usually charged it overnight but I wanted to see how much charge I lost over night and I was at 30% this morning...

I'm running stock everything with launcher pro. Before bed I cleared ram and turned off wifi but left sync on

As soon as I figure out how to post pictures ill post my battery stats.
[AT&T Samsung Galaxy S II SGH-I777] gtg465x:
Didn't look at your stats, but I would say an app is definitely dragging you down. Should be getting 0.5 to 1 percent drain per hour with wifi off unless you're in a poor signal area. With wifi on it should be even better. Also, you should set your wifi to never sleep. Cell radio uses more battery than wifi.
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
I would tend to agree, but no apps had been turned on. I just just reset the device and nothing was running. Nothing listed was more than 28 seconds, and that was GMAIL. The "MAIN" was the biggest wakelock and that was under KERNEL WAKELOCKS

I have pretty good cell service at my house, so I doubt that is the issue as well.

Here are the top items listed under my BBS wakelocks:

=========Wakelocks=========

*sync* (com.google.android.gm.Gmail): 28 s (28 s) Count:6 0.1%

MAIL_SERVICE (com.android.email.Email): 27 s (27 s) Count:48 0.1%

AlarmReceiver (com.sec.android.app.clockpackage.Clock): 13 s (13 s) Count:4 0.1%

AlarmManager (Android System): 13 s (13 s) Count:560 0.1%

GmailProviderProviderChangedBroadcastWakeLock (com.google.android.gm.Gmail): 9 s (9 s) Count:11 0.0%

*network-location-cell-update* (Google Services): 4 s (4 s) Count:1011 0.0%

ActivityManager-Launch (Android System): 4 s (4 s) Count:40 0.0%

sleep_broadcast (Android System): 2 s (2 s) Count:27 0.0%

Event Log Service (Google Services): 1 s (1 s) Count:14 0.0%

RILJ (Dialer): 1 s (1 s) Count:948 0.0%

GTALK_CONN (Google Services): 1 s (1 s) Count:65 0.0%

And under KERNEL WAKELOCKS

================Kernel Wakelocks================

"main" (): 36 m 56 s (2216 s) Count:4 7.7%

"AudioOutLock" (): 14 m 2 s (842 s) Count:120 2.9%

"[P]_*sync*" (): 5 m 8 s (308 s) Count:23 1.1%

"[P]_com.keramidas.TitaniumBackup.service.WorkerService" (): 2 m 35 s (155 s) Count:2 0.5%

"[P]_android.media.MediaPlayer" (): 2 m 17 s (137 s) Count:5 0.5%

"[P]_ActivityManager-Launch" (): 1 m 41 s (101 s) Count:190 0.4%

"[P]_DownloadManager" (): 49 s (49 s) Count:7 0.2%

"[P]_*network-location*" (): 39 s (39 s) Count:7 0.1%

"[P]_MAIL_SERVICE" (): 32 s (32 s) Count:15 0.1%

"[P]_MediaScannerService" (): 25 s (25 s) Count:2 0.1%

I will also add that I've seen the opposite be true with Wifi for my phone. I've put my phone on Airplane mode and then turn on Wifi and my battery will burn through battery faster than on 3G. I've looked at the battery chart and it seems to show the same thing: wifi consumes more battery than 3G on stand-by.

I'm starting to wonder if I have a bum device. I still have about 25 days to exchange it at Costco. May have to do so. I'll give it another few days, then take it back and exchange it for another device.
[AT&T Samsung Galaxy S II SGH-I777] neikirk:
Kernel Wake lock "sec-battery-monitor"

Hate to bother anyone with another battery question, but having pulled my wakelocks daily for a couple weeks while using Entropy's Daily Driver as my kernel (thanks!) under original AT&T stock rom, and then for the last several days under UnNamed v1.3.1 (also thanks!), I almost never get deep sleep over 50%, with sec-battery-monitor wakelocks always the worst offender, followed by svnet. Never do better than 5% per hour battery drain when phone is pretty much idle the whole time. I've searched the forums (I undoubtedly missed something) but can't seem to find much discussion of what might cause high numbers on sec-battery-monitor. Any suggestions?

Here are today's numbers for time on battery of 12h 32m, at which point I have 31% left on the battery, 84% used by Android OS; from BBS get: awake 3h27m (47%), screen on 24min; from CPU spy get: deep sleep 6h35m (52%), 200MHz 1h17m, 800MHz 2h58m (23%), 1200MHz 40m (5%).

Using adb shell cat /proc/wakelocks get:

sec-battery-monitor:	count: 8518;	expire_count: 0;	wake_count: 7881;	total time minutes: 131.76;	sleep time minutes: 131.73

svnet:	count: 9138;	expire_count: 9138;	wake_count: 0;	total time minutes: 114.73;	sleep time minutes: 112.88

wlan_rx_wake:	count: 2029;	2 expire_count: 029;	wake_count: 0;	total time minutes: 37.11;	sleep time minutes: 20.00

alarm:	count: 10537;	expire_count: 0;	wake_count: 0;	total time minutes: 32.05;	sleep time minutes: 31.96

alarm_rtc:	count: 8731;	expire_count: 386;	wake_count: 0;	total time minutes: 29.04;	sleep time minutes: 28.98

Statistics since last charge (pulled from dumpsys batteryinfo):

Time on battery: 12h 32m 32s 387ms (99.3%) realtime, 5h 56m 41s 537ms (47.1%) uptime

Total run time: 12h 38m 4s 530ms realtime, 6h 2m 9s 30ms uptime,

Screen on: 25m 58s 795ms (3.5%), Input events: 0, Active phone call: 46s 296ms (0.1%)

Screen brightnesses: dark 2m 32s 498ms (9.8%), dim 6m 50s 32ms (26.3%), medium 16m 27s 785ms (63.4%), light 5s 876ms (0.4%), bright 2s 605ms (0.2%)

Kernel Wake lock "mmc_delayed_work": 4s 736ms (9138 times) realtime

Kernel Wake lock "power-supply": 29s 52ms (8494 times) realtime

Kernel Wake lock "radio-interface": 5m 58s 154ms (343 times) realtime

Kernel Wake lock "ApmCommandThread": 672ms (55 times) realtime

Kernel Wake lock "sec-battery-monitor": 2h 11m 45s 552ms (8501 times) realtime

Kernel Wake lock "sec-battery-cable": 307ms (1 times) realtime

Kernel Wake lock "main": 26m 27s 321ms (29 times) realtime

Total received: 0B, Total sent: 0B

Total full wakelock time: 2m 17s 973ms , Total partial waklock time: 53m 33s 415ms

Signal levels: none 12h 32m 26s 615ms (100.0%) 5x

Signal scanning time: 1s 174ms

Radio types: none 12h 4m 51s 416ms (96.3%) 5x, edge 25s 290ms (0.1%) 1x, umts 2m 47s 749ms (0.4%) 23x, hsdpa 22m 11s 864ms (2.9%) 20x, hspa 2m 11s 600ms (0.3%) 21x

Radio data uptime when unplugged: 0 ms

Wifi on: 12h 32m 31s 35ms (100.0%), Wifi running: 12h 32m 30s 395ms (100.0%), Bluetooth on: 0ms (0.0%)
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
gtg465x,

To follow up on my earlier post, I uninstalled a few apps (ESPN Fantasy Football, Friendcaster, Opera Mobile) and have very few installed right now. I then charged the phone to 100% and then started monitoring the usage.

My phone has been off the charger for 4 1/2 hours and is at 89%. During that time, I used Navigation for about 10 minutes, and sent a few e-mails and texts messages. I also have Words with Friends (set to update every hour) still installed.

Looking at BBS, my Wifi Scan is at 4h 26m but I don't see Wifi Lock at all like I did this morning.

Awake time is at 34m and screen on is at 15min.

MAIN is not the highest wakelock anymore, now RADIO-INTERFERENCE is (17m / 2.7%).

Looks like my battery has stabilized after upgrading to UnNamed 1.3.1. I am VERY happy with this battery life. Hope it sticks!

Thanks for the input and motivating me to check the apps installed.
[AT&T Samsung Galaxy S II SGH-I777] kipliq:
bad cell reception would drain the battery quicker? What is good cell reception? Will leaving the phone plugged in all night harm the battery or phone?

Would Rooting my phone void my warranty? I also purchased the best buy warranty.
[AT&T Samsung Galaxy S II SGH-I777] gtg465x:
FYI, Words With Friends is famous for draining batteries quickly.
[AT&T Samsung Galaxy S II SGH-I777] dandrumheller:
Somebody chime in if I miss something here:

Poor cell reception (read: low signal strength) will drain battery faster because the cell radio has to transmit at higher power levels to maintain a solid connection to the tower. My rule of thumb is anything less than -100db is "poor" signal, -85 to -100 is decent, and below -85 is good. In the case of cell signal strength, the lower the absolute value, the better the signal. The best I have ever seen is -61, next to my microcell. I don't know specifically at what levels the phone will ramp up extra power to the radio.

Staying plugged in at night will not hurt your battery.

Rooting will void your manufacturer warranty (though if you read through the forums you will discover that you can return this device to an unrooted state leaving no evidence of rooting). I don't know best buy policy as it relates to their warranty and rooting.
[AT&T Samsung Galaxy S II SGH-I777] neikirk:
sec-battery-monitor problems

Tried an overnight test, auto sync off, in flight mode. Essentially never touched the phone for the entire test. For 12h 16m on battery: 48% left on battery, 95% Android OS, awake 5 hours, screen on 3 minutes; deep sleep 7 hours 15 minutes. Still have sec-battery-monitor as highest wakelock (140 minutes) followed by svnet (122 minutes). Wakelocks and dmesg attached. Any suggestions greatly appreciated!
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Yup, that and also in really weak signal, sync operations take longer, keeping the phone awake longer.
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
Just an update, this is day 4 of awesome battery life for me. I forgot to mention in my last update that another thing I had done was switch the governor from CONSERVATIVE back to ON DEMAND. Also calibrated the battery.

Saturday I went to a football and tailgated all day (noon to around 11PM) and the phone was at 58% when I got home. During the day I took video (1080P), lots of pictures, texted, uploaded pictures to Facebook, and had horrible service while at the game (notoriously bad service at our stadium for AT&T).

I re-installed ESPN's fantasy football app and the other apps I had uninstalled. Still have WORDS WITH FRIENDS installed with updates set to 1 hour. Today, my phone has been off the charger for 11 hours and battery is at 76%. I talked on the phone for 16m, played WWF a couple rounds, sent a few texts and got my e-mails (GMail and Microsoft Exchange work e-mail + calendar).

Using CPS Spy, it says my deep sleep is only at 53% (had been hovering in the 80's most of the time this weekend), but the battery life is still so much better than its ever been. My AWAKE time is only 1h 6m, which is the lowest I've ever seen for this much time off the charger (21m screen on) since I started using BBS.

This is the battery life I was hoping I'd get when I upgraded to the SGS2. After 3 weeks of frustration switching between ROM's, the only thing I can think of is re-calibrating the battery is what did it. I made a back-up to this configuration and doubt I'll be switching ROM's again until a stable and proven ICS ROM comes out (Which could be a while).

Thanks again for those who helped with the input.
[AT&T Samsung Galaxy S II SGH-I777] Audiochild:
Hi dmm5157, those battery times sound great! I'm still trying to get my performance vs. battery life locked in. To reference your post, by "Re-calibrating you battery" did you mean a full drain and re-charge or popping it out for several minutes? Thanks
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
I charged my phone to 100%, then booted into RECOVERY mode (while still plugged in), went to ADVANCED, then WIPE BATTERY STATS.

Rebooted the phone, then unplugged the phone and let the battery drain down all the way. Once the battery is drained, charge fully and use as usual.
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
Sweet deal. Thanks for sharing.
[AT&T Samsung Galaxy S II SGH-I777] A m a r a n t h:
Wow... I didn't know words with friends was that bad lol. Haven't dled it onto my droid though, was just on my iphone before..
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
It was a battery drainer there too. thought not as bad.
[AT&T Samsung Galaxy S II SGH-I777] PSXMachine:
Just wanted to share some of my own personal findings with anyone having persistent battery drain issues. I know the Facebook app has been mentioned before. I found that if I logged out of the app my battery life increased drastically. I went from getting 16 hours tops, on a good day, to 50 hours of use with 5% left. Running UnNamed 1.04 and Entropy's latest kernel. Hope that helps anyone who is a FB addict but doesn't want to go through the process of freezing and defrosting with TB every time you log on.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
So I had let my phone die completely and then charge to full while off. I then left my phone untouched for 4hrs 20mins and my phone went down to 88%. I am rooted and on stock. I have frozen bloat with TiBu and had autosync & wifi off. BBS said my phone was awake for 38mins and wifi scan is at 100%.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
This does NOTHING on our phone. Absolutely NOTHING. How many times to I have to say this?

https://github.com/Entropy512/linux_kernel_sgh-i777/blob/master/drivers/power/max17042-fuelgauge.c - Do you see an interface for loading battery heuristics/history into the fuel gauge? I don't.
[AT&T Samsung Galaxy S II SGH-I777] 21cdb:
I put the Google Voice app back on my phone, and things were going OK until last night. I went to bed with 42% battery, and woke up 6 hours later with 19%. I looked at the battery graph, and the phone was almost constantly awake from about 2.5 hours before I woke up. Before that it was fine. What happened was that I got a text through Google Voice at that time.

There wasn't much in terms of wakelocks, but svnet-dormancy was at over an hour since I went to bed.
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
I didn't say it worked, I just said what I did just before I started getting much longer battery life. Before the things I posted, my battery life was terrible: My phone didn't last but at most 12 hours. The last 5 days it's getting more than double that, and with decent usage.

I'm running your latest kernel with UnNamed 1.3.1 and have posted several times in this thread regaridng battery stats and information. If something else changed, I am unware of it.
[AT&T Samsung Galaxy S II SGH-I777] dmnall:
I found the culprit of my horrible battery life and it turned out the FB App was syncing every hour which caused my phone to never deep sleep when I was not using it. I reset the app to every 4 hours and magically my phone started using less then 1% of the battery every hour. I took it off charge last night around 11:15 pm then I left here work at 12:15 am. Used the phone as a flashlight to unlock my door and navigate my back patio, read emails and went to bed. This morning read more emails and deleted 100+ messages on one of my email accounts, took a 30 minuet call and have been at work since 9:30 am this morning, and deleting more spam as well as reading emails. Down to 67% vs the last week of dropping down to 5% battery is crazy that syncing every hour could kill a battery that fast.

HTH,

Charlie
[AT&T Samsung Galaxy S II SGH-I777] neikirk:
TM World Clock (v1.3.0) and sec-battery-monitor wakelocks

Add TM World Clock to list of bad battery hogs on S II. This was the origin of my extremely high number (and time) of sec-battery-monitor wakelocks. With TM World Clock and it's widget running I used between 6% and 8% of battery per hour even with phone idle and in flight mode, deep sleep pretty much never above 50%. With World Clock and it's widget removed I am at about 1% per hour when phone is idle (UnNamed v1.3.0 ROM), low number of sec-battery-monitor wakelocks, deep sleep around 90%.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I'm trying to get my wakelocks here through ADB but when i type in the first command it says access denied
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Are you running a stock kernel?

/proc/wakelocks may only be readable by root, haven't really paid much attention.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
No I'm running the latest version of unnamed, and I rooted using method 2a in the 'how to root w/o increasing flash counted method. I believe unnamed comes with entropys kernel...how can I check? I can boot into cwm.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
OK, then I am not sure what is going on - any custom kernel will have root privileges in an ADB shell.
[AT&T Samsung Galaxy S II SGH-I777] dandrumheller:
If on windows you may need to launch the terminal with administrator access, or in linux get su privileges first.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I'm on Windows 7. Tonight I let my phone die and then charged to 100% while powered off. I then unplugged from charger and removed battery for 10 minutes. I then put the battery back in and powered up the phone. I turned Wi-fi off and auto-sync off but left background data on. I'll post the results tomorrow morning. So when trying to do adb, all I do is open command prompt and enter those commands right? Or do I have to open something else?

Sorry if that is a dumb question but I'm still learning...I remember when I had to download the android debugger kit I had to install the platform-tools thing from that AVD manager. Should I open that after connecting my phone to the computer, then proceed with opening command prompt and typing the commands? Should I have USB debugging checked?

Thanks, hope to have an answer to help out so I can get these results to see why I am getting an average of only 10 hours out of my battery under med/heavy use, and others are getting 18-20hrs. I usually use my display around 40% and only sync my gmail and calendar.

I do sometimes get notifications from Contract Killer Zombies. I wonder if that is something that's causing a wakelock? Hopefully I'll find out in the AM.
[AT&T Samsung Galaxy S II SGH-I777] gr8hairy1:
Just in case try opening command prompt as administrator. There are a few ways but one way is to click start menu and type cmd. Then right click on cmd.exe and choose "run as administrator". That elevates the command prompt.

When you go to use adb all you will need open is the command prompt. Make sure you have the directory set for where you have adb. I have mine in the root of drive c: in a folder called adb for easy access. So after opening a command prompt I type in cd\adb then press enter. Now it shows c:\adb> and then I can start typing adb commands. You'll have to type in cd\(whatever the path is to the folder on your computer that has adb in it) Make sure your phone's screen stays on or adb won't be able to interact with it.

You can connect your phone before or after you open command prompt, but make sure USB debugging *is* checked on your phone under settings/application/development. That's part of what adb stands for 'android debugging bridge'. Make sure you have all needed drivers for your phone already installed, and that your phone properly installs once you plug it in to the computer.

Out of curiosity, what is your 'display time' for an average day? To find go to settings/about phone/battery usage and then select display.

Sent from my páhhōniē
[AT&T Samsung Galaxy S II SGH-I777] youngmoolah706:
Damn...I should try that!

Sent from Ray's SOOO EPIC 4G...CM7 *****ES!!!!!
[AT&T Samsung Galaxy S II SGH-I777] termleech:
Anyone else having issues with the most recent update to TapaTalk draining battery? I've been getting about 25-30 hours of battery. Have not changed anything except for download the newest version of TapaTalk. Last night took my phone off the charger and used TapaTalk for about 30 minutes. Went to bed and woke up to 56% left after 8 hours. Went to bed with 90%. Deep sleep was only 37% when its usually well over 90%. Anyone else seeing issues?
[AT&T Samsung Galaxy S II SGH-I777] F2a:
http://code.google.com/p/android/issues/detail?id=16721

Looks like it's the suspend and event/0 processes that are doing it to everyone. For those NOT having this problem, what did you do?
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
Okay so I was able to ADB my wakelocks and dmesg.

Phone was not touched for 6 hours 53 minutes and at 80%....wayyy too much drain. This was from a full drain to full charge(while phone was off if that matters) then after unplugging once at 100% I took the battery out for 10 minutes. Turned phone on, reset CPUspy and let it sit....deep sleep is at 5 hours.

Anyways here is the info hopefully you guys can help because I want awesome battery life like everyone else :)

EDIT: I don't know why my graphs are off on CPU spy, I took the battery out before booting up?
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I noticed quickly browsing through my wakelocks in BBS that Beautiful widgets was something that kept showing up, but I don't really know how to read the wakelocks in BBS.
[AT&T Samsung Galaxy S II SGH-I777] dmm5157:
@Jonnyredcorn

Be sure to hit RESET TIMERS on CPU Spy after you reset your device to get the timers back to zero.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I swore I did...oh well someone can still help me right? :)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
ffs, did you bother to read this thread at ALL? There's a reason I ask people to pull /proc/wakelocks in the very first post!

The link you posted has ZERO new information. There have been entire threads dedicated to this, and it is NOT an Android bug. It's proven to be a rogue app in every situation except for one on the Samsung Infuse which I have NEVER seen on the GS2 (because our device uses the BCM4330's Bluetooth capabilities - the problem happens when a BCM4330 is used for wifi but NOT Bluetooth as far as I can tell.)