yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
ok here's what I believe the problem of the diaperaing widget comes from. Java code is below for the ones who prefer reading code than prose.

When the widget is refreshed the first thing than is done is getting the references:

- from is the one from the settings, default is since unplugged

- to is always the current values

The stats are then obtained between these to references.

If the stats are empty (because a ref does not exist) then the fallback is tries and for new installs the fallback is the same as the first step but it doesn't matter. If the fallback doesn't deliver anything then........... the graph on the widget is hidden. So far so good except the graph is never set back to visible. This means when ever the widget fails once it will not show anything till it's reinitialized. That is of course is more than wrong...

In Java:

try
{
// [B]First attempt [/B]
Reference currentRef = StatsProvider.getInstance(this).getUncachedPartialReference(0);
Reference fromRef = ReferenceStore.getReferenceByName(refFrom, this);

ArrayList<StatElement> otherStats = stats.getOtherUsageStatList(true, fromRef, false, true, currentRef);

if ( (otherStats == null) || ( otherStats.size() == 1) )
{
// [B]attempt with fallback[/B]
// the desired stat type is unavailable, pick the alternate one and go on with that one
refFrom	= sharedPrefs.getString("widget_fallback_stat_type", Reference.UNPLUGGED_REF_FILENAME);
otherStats = stats.getOtherUsageStatList(true, fromRef, false, true, currentRef);
}
// [B]if stats are valid and not empty everything is good[/B]
if ( (otherStats != null) && ( otherStats.size() > 1) )
{

Misc timeAwakeStat = (Misc) stats.getElementByKey(otherStats, "Awake");
if (timeAwakeStat != null)
{
timeAwake = timeAwakeStat.getTimeOn();
}
else
{
timeAwake = 0;
}

Misc timeScreenOnStat = (Misc) stats.getElementByKey(otherStats, "Screen On");
if (timeScreenOnStat != null)
{
timeScreenOn = timeScreenOnStat.getTimeOn();
}
else
{
timeScreenOn = 0;
}

Misc deepSleepStat = ((Misc) stats.getElementByKey(otherStats, "Deep Sleep"));
if (deepSleepStat != null)
{
timeDeepSleep = deepSleepStat.getTimeOn();
}
else
{
timeDeepSleep = 0;
}
}
else
{
// [B]if we once go here we have a problem because that prop is never set back until the widget get re-initalized[/B]
// no proper reference found
remoteViews.setInt(R.id.graph, "setVisibility", View.GONE);
}
}

The commit for that: https://github.com/asksven/BetterBatteryStats/commit/a2d09d004226e490c16e4c5ce6808f637d6d19c1

This fix will be in RC6 that I plan to release tomorrow after spending some time on the root/wakelock problem
[BetterBatteryStats] smelenchuk:
I noticed a bug in the code snippet that's causing an issue I previously reported, namely that the fallback ref for the widget is never used: the string "fromRef" isn't updated to reflect the value of "refFrom", so instead of trying to get the fallback stats as expected, it tries getting the default stats twice (and obviously fails the second time).
[BetterBatteryStats] chamonix:
Thanks for that one (#329), is committed already (https://github.com/asksven/BetterBatteryStats/commit/8f4ba868e975687c77b38a28e78de3ce401de5e8)
[BetterBatteryStats] smelenchuk:
Now that's speedy development. Thanks!
[BetterBatteryStats] brendan_r:
Hi guys, I left my phone overnight and it drained from 56% to 12% over about 9 hours.

The battery stats suggest its been in deep sleep for 92% of the time so would like to get an idea why its draining at this rate.

I cant see any obvious culprits, could my battery be on the way out?

Would appreciate if someone could have a look at these stats and shed some light on this.

Thanks in advance
[BetterBatteryStats] Casanoaa:
Maps:

http://xdaforums.com/show...php?p=29420959

Uninstall facebook and use another app to facebook.

Turn off all locations services in settings/rom.

Try autostarts with these settings http://xdaforums.com/showpost.php?p=35755907&postcount=11160

Disable batterymonitorwidget (bmw)

Disable viber if you don't use it.
[BetterBatteryStats] lightosx:
better battery

Hi everyone, I took 2 idle samples last night, around 4 hours each. With the first one my idle drain was 0.2% which is pretty good, however with the second sample my idle drain was 0.5% even though the phone had a higher sleep percentage. I was wondering if someone could explain why the idle drain was higher the second time. I attached the two idle dumps. I noticed Facebook was at the top, so I've now frozen it and Google+ with TiB, but looking for more recommendations. Thank you! :)

Sent from my Nexus 4.
[BetterBatteryStats] kpavl01:
When I use this app, the draining is almost the same like when my wi fi is on all the time. When i turn wifi completely off and uninstall the app battery is ok again.

I can find DHCP but i cant configure my devices. I have sagem router.
[BetterBatteryStats] AestenD:
You're complaining about 0.5% drain? I'd love to get ONLY that drain :p

As a side note, was the "bigger drain" not from 100 while the other drain was? Because that first percent or two from say 100 to 98 will always be better than from Sat 90 to 88. An "artifact" if you will due to battery chemistry.

---------- Post added at 08:48 PM ---------- Previous post was at 08:47 PM ----------

You don't want your routers settings to have your phone use dhcp. You want to set a static ip.
[BetterBatteryStats] kpavl01:
http://www.cctvcamerapros.com/DLink-Router-IP-Setup-s/162.htm . In order to set a static ip, i need to manage devices? Am i right or not?

EDIT: I managed to set a static ip on my smartphone. Is that it? What if the draining still persist?
[BetterBatteryStats] lightosx:
The first sample was from 71-70% and the second one from 70-68%. I usually do it from 100%, but I thought if I just measured it from Since Screen Off it would be the same, I also set a Custom Ref. just in case and it seemed to give the same results as Since Screen Off.
[BetterBatteryStats] jlv3:
Excellent! Thank you!
[BetterBatteryStats] ccs86:
Anyone?
[BetterBatteryStats] starbright_:
Can you expert give me a hint what causes the phone to keep in awake state so long?

I am not able to interpret the data right. I just can see the awake time is much to long, and there are a lot of kernel_wakelocks. But no idea which app/system function is the reason for this. Please help!

Here are the logs:

http://xdaforums.com/showthread.php?p=36258800#post36258800
[BetterBatteryStats] stitch01:
I manage to do the above suggestions and below is my dumpfile.

Please check it guys. Thanks in advance! :good:

https://www.dropbox.com/s/h76bwhlyu41pxh0/BetterBatteryStats-2013-01-05_105349918.txt
[BetterBatteryStats] Grigoriy60:
Deep sleep missing

I found that deep sleep mode unexpectedly disappeared from my tab. :crying:

- wifi is on

- wifi on during sleep mode is NEVER

- location services are off

- some apps are frozen by TB (see in attach)

- settings in autostarts (see in attach)

Please watch dump, log and dmesg files in attach.

Waiting for your advises.

Thx.
[BetterBatteryStats] nobnut:
-1mA is definitely possible with a well set up phone. If it always reads -1mA however, I'd smell a rat. I'd be more comfortable seeing a few spikes in there.
[BetterBatteryStats] chamonix:
I love Berlin's mobile coverage
[BetterBatteryStats] nobnut:
LOL

I love Berlin's beer.
[BetterBatteryStats] cwburns32:
Almost certain it is Handcent. I unchecked Auto retrieve and the wake lock is...

Managewakelock: partial

com.handcent.nextsms.Handcent SMS

12 m 15 s Count 134 5.9%

Now a new culprit has taken it's place...

show keyguard

Android System

20 m 52 s Count 41 10.1%

Is this a normal one?

EDIT: And just 35 minutes later I have another huge spike of Handcent wakelocks, still can't figure it out. Handcent may be the problem :(
[BetterBatteryStats] beepsilver:
I'm pretty sure the battery widget is wrong...I use a stock Sprint Evo battery. Here is the currentwidget shot from today and the battery widget shot from two days back (with the 1%s)

View attachment battery_history.txt
[BetterBatteryStats] huwande1acruz:
Other Usage

===========

Awake (): 1 h 44 m 24 s (6264 s) Ratio: 16.1%

Screen On (): 1 h 26 m 2 s (5162 s) Ratio: 13.2%

Wifi On (): 42 m 40 s (2560 s) Ratio: 6.6%

Phone On (): 2 s (2 s) Ratio: 0.0%

=========

Wakelocks

=========

AlarmManager (Android System): 4 m 15 s (255 s) Count:4809 0.7%

ActivityManager-Launch (Android System): 2 m 37 s (157 s) Count:453 0.4%

SCREEN_FROZEN (Android System): 13 s (13 s) Count:518 0.0%

sleep_broadcast (Android System): 11 s (11 s) Count:497 0.0%

RILJ (Dialer): 6 s (6 s) Count:276 0.0%

SMSDispatcher (Dialer): 6 s (6 s) Count:2 0.0%

show keyguard (Android System): 5 s (5 s) Count:18 0.0%

MediaScannerService (Media): 4 s (4 s) Count:2 0.0%

StartingPopupUtilsService (UID): 3 s (3 s) Count:23 0.0%

Event Log Service (Google Services): 3 s (3 s) Count:55 0.0%

WifiService (Android System): 3 s (3 s) Count:573 0.0%

Checkin Service (Google Services): 2 s (2 s) Count:102 0.0%

GSM (Dialer): 2 s (2 s) Count:3 0.0%

GTALK_ASYNC_CONN (Google Services): 2 s (2 s) Count:2 0.0%

DownloadManager (Media): 1 s (1 s) Count:3 0.0%

PowerAMP scan (UID): 1 s (1 s) Count:2 0.0%

DhcpHandler (Android System): 1 s (1 s) Count:521 0.0%

*network-location-cell-update* (Google Services): 1 s (1 s) Count:36 0.0%

StartingAlertService (UID): 1 s (1 s) Count:3 0.0%.

--- heres my dump file on my battery stats. Can someone tell me if its normal? thanks!
[BetterBatteryStats] BobbyLoblaw:
Regarding my previous post

I rebooted my phone last night and datatracker-fd didn't start. I'm now at 93% percent battery after 9h.

I do have a question regarding the total awake time during this 9 hours.

BatterBatteryStats->Other ->Since charged reads:

Since 9h 9m 53s

- Awake ratio 4.8%

- Screen On ratio 3.6%

This is seems okay but i'm reading something different in Gingerbread's Settings->Apps-> Battery use

(Sorry for bad quality. I took the photo with my s40 nokia)

This reads the same 9h 9m xxs uptime but the graph is what bothers me. It seems like it has more than 4.8% awake ratio like shown in BBS. Way more blue dots shown comparing to Screen On bar.

Any theories?
[BetterBatteryStats] ejstubbs:
Battery Monitor Widget is known to have problems getting current readings from some phones - it's stated right in post #1 in the main BMW thread: http://xdaforums.com/showthread.php?t=905999. Some phones - like my Defy - don't provide a means to read current drain directly so BMW has to try to guesstimate it. Current Widget doesn't bother to try anything clever like that: if your phone doesn't report current, Current Widget shows 0mA. That makes it unusable on my phone, whereas BMW is sort-of usable, if you leave it running so it can estimate current over a period of time, but still not very reliable.

BMW has a "Request mA support" function in the settings for folks whose phone isn't properly supported. It generates an e-mail to send to the developer with all sorts of info about your phone, and an extract of the battery history. I can't comment on how responsive the developer is to these requests.
[BetterBatteryStats] m444266:
does anyone know if there is a way to get an alarm dump with a non-rooted phone?
[BetterBatteryStats] chamonix:
Considering that your phone was in use (screen on) most of the time the reading ist pretty ok but not very representative. I suggest that you take another reading after leaving your phone unused for 1 hour+
[BetterBatteryStats] nobnut:
Updated version of BBS on the Market! Support a great Dev and do your bit for world peace! :)

If you haven't already bought it, get it quick before Apple ban it!!

Tell your friends (unless they own an iPhone, in which case you should punch them in the skull).
[BetterBatteryStats] KennyLegend:
Def a worthwhile app.

Done ;)
[BetterBatteryStats] Bloomfield87:
Just thought I should say thanks for this app, it's very useful :).

I'm liking the links for processes that you've started adding too, nice addition :D.
[BetterBatteryStats] Szczepanik:
Location permission

Market update of BBS Pro works well thanks. At the same time I updated Android Optimiser and share screenshot of function showing apps with location permission as this may help.

Cheers

Tom
[BetterBatteryStats] nobnut:
That's a handy find. Very useful to see at a glance which apps use which permissions.

Good one.
[BetterBatteryStats] devbot:
First, thank you for this app which is great and helped me to correct a lot of problems to improve my battery life.

I have now a good battery life, more or less 3 days with 40 minutes screen on per day on 2g only (we have a bad 3g connection here so I activate it only when I need it) and I switch off data and sync during the night with Tasker. But looking at the battery stats I see that my phone is very often awake when the screen is off (see attachments).

Looking at the partial wakelocks, everything looks good (I think)... I did a dumpsys on AlarmManager because a count of 6601 seemed a lot. Then I saw that Viber and Battery Monitor Widget had awakened the phone 4000 times so I removed both apps but I still have a lot of awake time (2/24 hours). Is this normal?

I am using a SGS2 with VillainROM 2.5 and SpeedMod t40 kernel
[BetterBatteryStats] suku_patel_22:
good app, will try it out
[BetterBatteryStats] kitepascal:
So you have one time context profile for activating airplane mode and another one for disabling it?

Can anyone confirm that this uses less battery?

I lose 8% of battery during 12h airplane mode with one (from - to) profile.

I have another time context profile (8:20 - 8:25 - every 5 minutes) for speaking time at 8:20 and checking weather... 8:25 speaking time and weather.

Is this high Tasker wakelock count normal behaviour?

M (net.dinglisch.android.tasker.Tasker): 13 s (13 s) Count:1411 0,0%

E (net.dinglisch.android.tasker.Tasker): 3 s (3 s) Count:1412 0,0%

All during 12h airplane mode with 5m scrren on (42m awake)...

BetterBatteryStats Dump and AlarmDump attached.

Any improvement suggestions?

Thx

Pascal
[BetterBatteryStats] kimaro:
Great app! I doubled my batt life thanks to this app

Can you share a link to android optimiser? I can't find it in market and it looks cool.

Thank you in advance
[BetterBatteryStats] k1000716:
Try here for the XDA thread, or here for the market link.
[BetterBatteryStats] It_ler:
In BBS dump I can see that wifi is your main battery drainer.

BatterMonitorWidget Pro also creates some Alarms, but this is minor.

But I can't find a reason for your massive wifi/WLAN wakelocks.

I you turn wifi off, everything is Ok?

Have you tried to switch from DHCP to static IP? Maybe this can helpo in your case.

Good luck !

P.S.:

Maybe someone can have a closer look at your logcat?!

EDIT:

I found some error for YouTube and many entries for Wetter.com.

Maybe you should try again with YouTube disabled/frozen and Wetter.com widget removed.
[BetterBatteryStats] Casanoaa:
Have you set your mac adress for your device to the router. Advanced wireless settings / connected devices

---------- Post added at 10:21 AM ---------- Previous post was at 10:18 AM ----------

Try install latest stable bbs version.

Disable facebook and use another app/browser.
[BetterBatteryStats] It_ler:
Looks quite good IMO.

Please install latest stable BBS app version, which is v1.11.0.0 ATM.

Media Scanner is running for a while ... have you got many files on your sd card(s)?

Or have you created some nandroid backups? Then you can try to create a ".nomedia" file (e.g. with Root Explorer) in those folders where you never will save any media files. Media Scanner will skip those folders (and all sub folders).

Good luck !
[BetterBatteryStats] chamonix:
What is it you don't like about the "current" behavior?
[BetterBatteryStats] chamonix:
Working on it right now: https://github.com/asksven/BetterBatteryStats/issues/330
[BetterBatteryStats] :
could the experts please have a look into my BBS dump file.

how can I decrease further wakelocks or better to avoid needless wakelocks?

many thanks for your support.

have a great weekend

Juergen

PS: the phone was absolutely untouched for this dump file.
[BetterBatteryStats] Casanoaa:
Disable 3gwatchdogpro

Disable facebook and use another app /friendcaster

Turn off locationsservices in rom/settings

See post 3 in this thread for maps.

DIsable google search with tb if you don't use it.
[BetterBatteryStats] labrum:
Battery is draining, especially since switch to CM9

Hi!

I would be really happy if anyone could take a look at my dump-file. The battery is draining 15-20% over night which is much more than it did before switching to CM9. I have been googling this problem for many hours but I can't seem to find a solution, my knowledge in this area is not enough..

Android OS processes seem to take a lot of power.

THANKS!

Regards

David
[BetterBatteryStats] Casanoaa:
Disable bmw

disable facebook

turn off locationsservices in rom/settings

disable greenpower2

Use gokhan morals fastdormancy app

Disable viber and skype if you dont use them.. if you use them turn off autolocation.

Provide an idle log next.

Unplug and leave phone 4 hours without touch. Dump a file
[BetterBatteryStats] PIRATA!:
Hi guys!

After a night in leaving my phone discharge I had these Alarm results this morning:

android (): Wakeups: 345
Alarms: 88, Intent: com.android.server.LightsService.action.UPDATE_SVC_LED
Alarms: 632, Intent: android.intent.action.TIME_TICK
Alarms: 30, Intent: com.android.server.action.NETWORK_STATS_POLL
Alarms: 86, Intent: com.android.server.ThrottleManager.action.POLL
Alarms: 58, Intent: android.appwidget.action.APPWIDGET_UPDATE
Alarms: 10, Intent: com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD
Alarms: 3, Intent: com.android.server.NetworkTimeUpdateService.action.POLL
Alarms: 189, Intent: android.content.syncmanager.SYNC_ALARM

com.sec.spp.push (): Wakeups: 97
Alarms: 5, Intent: com.sec.spp.push.ALARM_TIMER_ACTION
Alarms: 1, Intent: com.sec.spp.push.REQUEST_TIME_OUT_ACTION
Alarms: 85, Intent: com.sec.spp.push.HEARTBEAT_ACTION
Alarms: 6, Intent: com.sec.spp.push.ALARM_TIMER_ACTION

com.google.android.gsf (): Wakeups: 89
Alarms: 8, Intent: com.google.android.intent.action.GTALK_RECONNECT
Alarms: 36, Intent: com.google.android.intent.action.MCS_HEARTBEAT
Alarms: 15, Intent: com.google.android.intent.action.SEND_IDLE

I have uninstalled GTalk and disabled all its entries from the Google Services Framework, but there still exist an entry in com.google.android.gsf that mention GTalk! What have I forgot?

Then in android I think I have a lot of android.intent.action.TIME_TICK alarms... don't you think? Is it that that causes so much wakeups??

Please take a look at my dumpfile please: http://db.tt/2nUdr6i2

Here are some screenshots:

Thank you.
[BetterBatteryStats] Casanoaa:
Firstly don't hang you on gsf. Gsf is not gtalk but all google services in all. You can get it low but not to zero.

Time tick is normal and again don't hang you up on this either.

Disable this with tb.. If you don't use push

Disable sns

*sync*_com.sec.android.gallery3d.sns.contentprovider_Account {name=Stefano Simonetti, type=com.sec.android.app.sns3.facebook} (com.sec.android.app.sns3.SNS): 49 m 30 s (2970 s) Count:831 5.5%

*sync*_com.android.contacts_Account {name=Stefano Simonetti, type=org.mots.haxsync.account} (org.mots.haxsync.HaxSync): 29 m 38 s (1778 s) Count:89 3.3%

Don't use autosync use manual sync.

use another service than facebook. browser /friendcaster

turn off google contacts sync autosync.

Start with this.
[BetterBatteryStats] :
hi,

thx for your quick feedback.

0) ok, will do

1) immediately done :)

2) ok, will do

3) the maps "configuration" as mentioned in post 3 was actual done

BEFORE

the BBS dump. :( :( Please support for further investigation

4) ok, will do

thx again
[BetterBatteryStats] Casanoaa:
It can't be right that you allready have disabled locations services and stopped maps app with autostarts my friend. That can i see in your dump.

Also sign out of latitude

http://xdaforums.com/showpost.php?p=29420959&postcount=7059

Looking forward to your next dump
[BetterBatteryStats] arqsha:
@fifamaniac, On my opinion it would be nice to start with getting sort of alternative for HD Widgets you have. Seems it takes a while to update that one. Next is known maps / latitude problem - you can start here and then play around and see if the problem is fixed. Although, additionally I would recommend to restart/reboot the phone when charged, so it resets all the starts and plus to that, and pls save to log to .txt, so it doesn't pollute the thread.

---------- Post added at 12:44 PM ---------- Previous post was at 12:28 PM ----------

@lirong, actually, I believe it should be this way from very beginning - if you don't use Bluetooth, so that should be off by itself and then autostarted when pairing received. It kinda works this way with GPS on many ROMs. I have started testing on my device now and will see if bluetooth on standby eats much.

I have also noticed some exceptions for your SD card, not having a Samsung myself but some people recommend wiping the cache (source), so try it out and revert with another log :good::cowboy:
[BetterBatteryStats] :
Here you can see my current maps autostarts config, should be as described in post 3, shouldn't it? :confused:

The other things, I have to recheck again.

Edit:

Where can I disable/sign-out from Latitude?

Next bump tomorrow then :)
[BetterBatteryStats] Casanoaa:
Acces autostarts app and press view and untick all. Then you should see more on maps to disable : )

Have you also disabled location in settings of your phone

For latitude look for it in maps app. Open maps app and look for it there.
[BetterBatteryStats] Hilmesh:
Hi there, Can somebody just have a look and advise.
[BetterBatteryStats] arqsha:
@HIlmesh, with you up time of 1 d 15 h 58 m, awake 3 h 5 m and screen on with 2 h 47 m I don't think you've got an problems with wakelocks or whatsoever. You were not even down to <5%! So I might suggest you advising us instead :):cool:
[BetterBatteryStats] BullHorn7:
Hi guys, I disabled Fast Dormancy, removed the autostarts from GTalk and eBay and got the new beta version of SwiftKey Flow that consumes less data.

Please disregard my Wi-Fi connection, I have a Tasker profile that automatically enabled Wi-Fi whenever I am home. A different profile disables sync & data - and enables it for 90 seconds every 1 hour...

Is this good or can I improve it?
[BetterBatteryStats] Hilmesh:
Hey Arqsha Thanks for the kind words. Actually there are folks around here who get more than 5 Hrs screen on time and that is what I am trying to achieve. Am still to find the solution though. Maybe I may never achieve ;). In the process I always try and help with whatever limited knowledge I have.

---------- Post added at 01:56 PM ---------- Previous post was at 01:51 PM ----------

Hi there, i think you are still having autosync ON. if you can go for Manual Sync things can get better :). Also GPS & backup service is ON. Maybe turn them off if not needed and gain more :)
[BetterBatteryStats] arqsha:
@Hilmesh, that's right. Heard, some people can get around 8h (!!!) screen time with my phone... But me personally couldn't get more than 3,5... :mad::cowboy: Tired of looking into the kernels and wakelocks... PPSSPP time :D
[BetterBatteryStats] chamonix:
Release 1.12RC6

New release is up
[BetterBatteryStats] BullHorn7:
Oh, you are right about GPS, I've had the 'Wi-Fi & mobile network location' feature enabled and didn't even notice. Backup service is on but it's limited by Tasker. I will limit it even further (No point backing up every hour... once a day is enough). Thanks!
[BetterBatteryStats] arqsha:
danke schön!
[BetterBatteryStats] starbright_:
Thanks for look at this.

Yes WIFI is my problem, but why? Is this Android itself or some APP - and which? Without knowing that BBS doesn't help much here (or at least I am unable to use it in a proper way)

I'll try the DHCP stuff, but with not much hope, as this has been not changed in last time.

I will remove this two Apps and watch again.

At least without WIFI off it behaves much better. Not quit sure how much AWAKE is normal if the phone is not used.

Is there any expierence with this?