yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
Somewhat OT but I wanted to take a few minutes to tell you where I am with the toolchain switch, what advantages I can already see and what the next steps are.

As some may know I am still (prod production releases) working with Eclipse as my IDE. The reason for that is that BBS was started back when there was no Android Studio and I was reluctant to go through the pain of switching workflows.

But the pain has been increasing in some areas:

- The Eclipse Android Tooling (ADT) does not get updated anymore and sometimes fails

- Most libraries can be easily added as Android Studio dependencies but not to Eclipse: this leads to me not being able to integrate them as I would like to, esp. for certain UI candy

- The emulator that comes with Eclipse is very slow, making it almost impossible to test without physical devices. This makes testing on multiple devices tedious

I have now moved to Android Studio and it feels pretty good. It took me 1 1/2 days to switch to the new project structure and since them I can already see the benefits:

- easier way to run unit-testing and device testing thanks to the new emulator

- modern build technology (gradle) so now I can run a centralized build and tests on CircleCI everytime I commit

- fast emulator so that I can test on multiple android versions at once. This lead me to really start investing in adding more automatic testing

- the tests caught the pre-lilipop bug introduced in 2.2 and I had information at hands to fix it much faster

The road ahead:

- I need to set-up an alternate build so that I can build both the XDA and the Google Play version with one set of build-definitions

- finalize the automatic testing for the four android versions I am targeting for testing

- continue investing in automated testing

Once this is done I will start publishing BBS from the new toolchain. Next steps will be:

- change some things to the error handling and incorporate HockeyApp so that I get constant telemetry

- delivery an xda-build for every commit automatically

- delivery google play alphas and betas for chosen build automatically

I hope you will like this change resulting in more frequent builds and shorter cycles for fixes and features.
[BetterBatteryStats] gerardo87:
Yes, I've found the same on Google but it doesn't help so I've asked everywhere but with no luck. I decided to try to freeze it and see what happens. If can help that process seems to be on all latest note 7 port. I will report if I have some results to share [emoji6]

Inviato dal mio SM-G930F utilizzando Tapatalk
[BetterBatteryStats] Fir3lordZuk0:
I did this on my non-root Moto g4plus..But I am not getting any stats other than basic summary.
[BetterBatteryStats] sleepyg72786:
[MENTION=1330150]chamonix[/MENTION]

Just wanna report that everything is working as expected on the latest version (v2.2.2.0).

Galaxy S4 (SM-S975L)

OptCM14.1 by JDCTeam

Thank you for your hard work and dedication to this project. It has helped me maintain my battery life dramatically. :laugh: :highfive:
[BetterBatteryStats] chamonix:
What does settings - advanced - system apps say about the BATTERY_STATS permissions?
[BetterBatteryStats] Fir3lordZuk0:
It's saying battery_stats not granted

I have attached screenshot
[BetterBatteryStats] rbt2008:
If someone interested, it seems that PureNexus ROM was causing such issues. Changing PureNexus to Carbon helped a lot. Right now I have only 0.5% per hour idle drain with no changes in smartphone usage.
[BetterBatteryStats] relevant_placeholder:
Have you reported it?
[BetterBatteryStats] rbt2008:
Right now :)
[BetterBatteryStats] chamonix:
This means that the permission was not granted. Read the instructions again and repeat. Once you did it right the advanced settings will confirm that
[BetterBatteryStats] Tozenator:
Hey guys, I'd appreciate if you could help me out. I have Oneplus 3T running OxygenOS 3.5.3. I downgraded from 3.5.4 because it had battery issues, but I suspect I still have some kind of battery problem. Android System and Google Play Services are constantly on top of my battery list. I cleared the cache from recovery once as well as the cache from Google Play Services, but it seems to persist. I'm getting 4-5 hours of SOT which is decent enough but I'm still bothered about the drain. I took a logcat from last night, does it show anything irregular?:)
[BetterBatteryStats] j.p.m:
I do not know what happens to this application on my devices.

I have a nexus6p, a MotoZ and a MotoXStyle and in all three the application restarts or has forced closures several times a day.

I have activated the app on my three devices through adb permission, two of them work under android 6.0.1 (MotoZ and MotoXStyle) and the nexus has the usable 7.1.1 android patch.

Any solution so I do not happen to this O?

Also say that in them also works the GsamBateryMonitor app and it is also activated by the adb permission.
[BetterBatteryStats] chamonix:
In fact your consumption profile does not look that bad:

============
Battery Info
============
Level lost [%]: Bat.: -3%(100% to 97%) [0,5%/h]
Voltage lost [mV]: (4351-4283) [12,2%/h]
===========
Other Usage
===========
Deep Sleep (): 5 h 21 m 18 s 96,1%
Awake (Screen Off) (): 10 m 40 s 3,2%
Screen On (): 2 m 31 s 0,8%
Wifi On (): 5 h 34 m 30 s 100,0%
Wifi Running (): 5 h 34 m 30 s 100,0%

================
Kernel Wakelocks !!! wakeup_sources !!!
================
qcom_rx_wakelock (): 2 m 7 s Cnt:(c/wc/ec)1132/170/1132 0,6%

1. 0,5 % per hour would bring you to 200 hours of standby with that profile; as I said, not bad

2. your wifi stack receives broadcasts and keeps waking up your device. You could either investigate that further if you "own" the wifi you are attached to (uPnP) or turn off Wifi when your screen is off
[BetterBatteryStats] Tozenator:
Thank you for taking the time to look at my logcat. I do indeed own the wifi, I'll look into it. :)
[BetterBatteryStats] ciorofleasca:
Great app! Thank you
[BetterBatteryStats] Isnotok:
7.1.1

Good day, comrades. Will appreciate some help with 3-4% loss over night on Tablet Z LineageOS 14.1 (7.1.1) with airplane mode active and ForceDoze app for immideate dozing after screen is off, Wi-Fi is off too. Thank you.
[BetterBatteryStats] githyanki:
Although the drain is good at 0.4%/hr, your phone never went to sleep. I don't know if it's an issue with your phone not being able to Doze properly, or something else going on.
[BetterBatteryStats] v12xke:
Sensor: Significant motion(12)

My first idle drain log, and it ran for 11 hours, 45 min. Overall (I think) it was quite good with only a 0.3%/hr battery drop and a 97.3% deep sleep. One curious thing though is the significant motion sensor.

(Google Play Services) Sensor: Significant motion(12), wakeup=true, Time: 5 h 47 m 37 s

(Android System) Sensor: Significant motion(12), wakeup=true, Time: 30 m 49 s

The phone was sitting unplugged on a cradle at about a 45 degree angle. It was untouched the entire night until I picked it up this morning. Tonight I will run another log with Wi-Fi off on sleep and the phone laying flat on the table, but I think it's going to be similar. It was the only thing unusual I could spot, and did not know what to make of the "wakeup=true". I've attached the log for anyone interested, and maybe I can learn something here. Thanks.
[BetterBatteryStats] chamonix:
You should not worry too much about the time the sensor was active, it does not mean your phone was awake for the same time as sensors run on their own chips. Nevertheless there are wakeups/alarms caused by those and they are related to google's location services. In order to reduce the overhead there are different approaches:

- agressive: suppressing some services / alarms. You will find experts in this thread

- conservative: by disabling location history as well as location tracking, combined with some Wifi settings you will be able to suppress some of the overhead
[BetterBatteryStats] MysticGolem:
In terms of 2.2.2 the Sensor section does work on my Galaxy S4, stock rom 4.4.2 and rooted.

In 2.2.1 as previously mentioned the Sensor section did not work.

Keep up the good work! :)
[BetterBatteryStats] Royal hacker:
Spiservice:mroutingWakelock

This is a strange wakelock and is keeping the device awake all the time. I could pinpoint the problem to package com.nxp.spi dont know what it is

Bbs screenshot : http://imgur.com/hnTSd1Q

Dumpfile: http://pastebin.com/LPJzvfC5
[BetterBatteryStats] anpax:
Has your device NFC embedded? Seems to be the driver.

Postcount prevents me from posting a link, it's the first hit from googling "com.nxp.spi" (including the quotation marks).

github.com/NXPNFCProject/NXPNFC_P61_SPI_Services/blob/master/packages/EseSpi/AndroidManifest.xml
[BetterBatteryStats] Royal hacker:
No nfc is off and bluetooth is also off.

The more scary thing is it went after a reboot . So, what could possibly have caused it .
[BetterBatteryStats] anpax:
Donno - but I'd consider a reboot fixing it good news. :)

Maybe simply toggling NFC (or BT?) on/off or some services like HotKnot/Android Beam or any user app providing/asking for NFC access had triggered it.
[BetterBatteryStats] DB126:
Likely NFC related despite 'off' indication/setting in UX. Requested and actual states do not always align. An occasional reboot is a marvelous elixir. :)
[BetterBatteryStats] d08speed3:
alarm_wakeup_locator

What is it and what can I do to prevent it from being my alarms most issues?
[BetterBatteryStats] githyanki:
Find out what is asking for location info and disable it.

Possibility's are maps looking for traffic/stuff going on around you (There's a few things to disable in maps), Facebook looking for nearby friends. I uninstalled and just browse in chrome. Weather app/widget checking for updates. Set them to a static location or disable updating while screen off.

There may be others, but you should get the idea from these :)
[BetterBatteryStats] v12xke:
Is there a recommended text editor/mode to use when parsing the BBS log?

EDIT: nvm ... just found WordPad works a whole lot better than Notepad for viewing the log file.
[BetterBatteryStats] Mesmurized:
For long-time users who used the .zip to installed BBS as a 'system-app' :: I believe the recent upgrade to (2.2.2.0? which doesn't require the system-stuff) somehow interferes and prevents doze mode.

I uninstalled the update, then used the uninstall .zip to remove the system-app helper and I'm back to normal. Will continue to test doze today before reinstalling the latest BBS app for final confirmation.

Nexus 5X, Pure Nexus 6.0.1

Update: confirmed
[BetterBatteryStats] kartik93:
Sorry
[BetterBatteryStats] herubrand:
Seems like an unnecessary drain going on while the phone tries to go into deep sleep mode. Plus I am getting "no stats have been collected yet on Kernel Wakelock" tab, any fix for that?

The app (2.2.2.0) is installed in system mode and has access to dump and battery stats and kernel wakelocks using API is selected.

Two bettery stats shared, hopefully they'll help.

Best Regards and Thanks.
[BetterBatteryStats] kartik93:
I cannot get kernel wake locks
[BetterBatteryStats] chamonix:
Confirmed what exactly?
[BetterBatteryStats] Mesmurized:
Confirmed everything is working normally after all traces old BBS were removed and the new version installed.
[BetterBatteryStats] usmani:
Hi, I'm having this problem, I'm on cm14, is this normal?
[BetterBatteryStats] kartik93:
Me too
[BetterBatteryStats] wian:
[MENTION=1330150]chamonix[/MENTION]: thank you for your continued support and updates for both the paid and free xda version. I bought a new phone and experience some drain so decided to buy the play store version this time. Thanks!
[BetterBatteryStats] marietto79:
I have a problem with this fantastic app that never had before.

when i start the app i have this error:

"deteced problems with app native libraries (please consult log for detail):

libavcodec.so:text relocations

libswresample.so: text relocations"

how can i solve this"

thanks everyone :D:D:D

i'm on asus zenfone 2 ze551ml with Resurrection Remix 5.8.0 android 7.1.1
[BetterBatteryStats] Ludzee:
https://drive.google.com/file/d/0B9PwR58wV4y5X1JMQjZxRHlpTTA/view link to log file

Anyone who is good at these things can see whats up? Phone has been like this since i got it a few days ago (RMA).
[BetterBatteryStats] BIG_FAN:
Check if I/O stats is disabled ?

(I have no idea what I am talking about :| )

Edit: in BBS advanced settings there is a option called kernel wakelocks using API try enabling that?
[BetterBatteryStats] BIG_FAN:
U have location enabled?

Are u connected to any media device?

Turn off Wi-Fi maybe?

(com.google.android.location.geocode.GeocodeService) Active since: 13 h 30 m 30 s
[BetterBatteryStats] jlb1959.01:
I'm having no problem at all and never have,doze works fine,regardless of which previous version I've used..
[BetterBatteryStats] Ludzee:
Nothing of those works or are the fault, unfortunately
[BetterBatteryStats] TNSMANI:
You have to provide idle dump. What you have provided contains usage details for the period when the phone was being used.

Charge your phone to 100%, unplug and leave it idle for >6 hours. Unlock your phone and immediately save the dump, preferably within one minute of unlocking.
[BetterBatteryStats] notameme:
Is it possible to enable graphs in Android 7
[BetterBatteryStats] githyanki:
I use desmos for my graphs.
[BetterBatteryStats] drewski_1:
I see that on my Shield Tablet. Partial warlocks are displayed, though
[BetterBatteryStats] munichsfinest:
For me, it suddenly started working all by itself as it seems. At least I didn't do anything. :confused: EmotionOS 7.1.1
[BetterBatteryStats] matssa:
Strange, I too have this issue on LineageOS 14.1 Unofficial... I installed it as system app through app, nothing. I'm not using a custom kernel though.
[BetterBatteryStats] n0ke:
Couls aomeone help me? Loosing 7%/hr on sleep..
[BetterBatteryStats] n0ke:
Here R my stats 7%/hr on :/
[BetterBatteryStats] Portgas D. Ace:
Screen On (): 1 h 1 m 2 s 12,6% -> that's not how a proper log file should look like. Wee need a log file that only shows the idle time of your device ( = time when you don't use your device). Please follow the steps below:

1. charge your phone to 100%

2. unplug your device from charger

3. leave your device idle for about 5 hours (best way: at night while you sleep). DO NOT USE YOUR DEVICE DURING THIS TIME!

4. turn on your device, open BBS and save the log file immediately

5. upload the log file here

Using your device during idle time will result in useless stats, as the battery drain is different while you use your device compared to idle period.

By the way: check the OP and post #2, a newer version of BBS is available.
[BetterBatteryStats] Barquero:
Xiaomi Redmi 4 Pro bug

Hi.

Please help.

I use last version from GP. After some days I can not read follows points:

Summary

Partial Wakelock

Process

Sensors

After reinstall all works some days...
[BetterBatteryStats] n0ke:
Here r my standby stats ...
[BetterBatteryStats] githyanki:
I see very little that would cause such a drain on your battery. It may be that you just need a new battery.
[BetterBatteryStats] n0ke:
But AccuBattery sags battery health is good and im almkst having 3000mAh of 3000.. (Phone isnt a month old)
[BetterBatteryStats] TNSMANI:
Except the Google app downloading about 2 MB and

may be

some issues with WiFi, I also don't see much to justify this drain.

How is the mobile signal at your place? Can you attach a screenshot of the batterystats page?
[BetterBatteryStats] n0ke:
Phone signal is good (having full bar) but the drain is on airplane mode aswell..

I flashed a new rom now so I don't have a bs page of that log now .. but everytime Android System and Kernel (Android OS ) was on the top
[BetterBatteryStats] TNSMANI:
Ok, check out the new ROM.
[BetterBatteryStats] veekay:
Same here - had to enable the API option to get it working again.
[BetterBatteryStats] hmillos:
ok guys,

I followed the instructions, I hope this dump works, looks my phone is having troubles going into deep sleep mode. I think I need your magic :)

Thank you in advance.
[BetterBatteryStats] DB126:
Google location services has gone wild. Reboot your device; make sure NlpCollectorWakeLock is limited per guidance.
[BetterBatteryStats] sohebq:
Without Xposed on Nougat, how is it possible to limit wakelocks from pathetic Google services.
[BetterBatteryStats] DB126:
Short of tinkering with kernels no immediate solutions beyond disabling services and/or functionality (eg: location) when not needed. That said, I have found Google Service to be better behaved on each successive Android version. Limited far less crap on LP than KK and hardly concern myself with wake locks on MM (I do use Doze/Greenify/Xposed to keep idle services in check). Assume that general trend continues into Nougat.

Is there still drain/losses associated with Google everywhere? Absolutely! It is worth the time to mess with them? Depends on device, app portfolio and personal priorities. On my nothing-special Moto G4 Play (Stock MM 6.01) idle drain rates average <0.20% per hour or under 5% per day with full location, GPS and push mail (!!) enabled. Device wakes, does what it needs to do and quickly falls back into deep sleep. Screen on drain rates are reflective of environment (screen brightness) and activities being performed at the time. Easy to stay off the power grid for several days on this modest device without turning a bunch of dials.

Looking at BBS (or tool of your choice) there are hundreds of wakelocks during idle periods with outrageous timeframes. One has to remember a wakelock time block represents a max value that is rarely realized. Focus on cumulative screen off wake time and associated battery run down. Go after the big hitters; ignore the rest. Easy to get bogged down in minutia.
[BetterBatteryStats] TheeWolf:
HI everyone, I hope someone can help me.

I'm using a Nexus 5X (7.1.1) with Pure Nexus rom, stock kernel. lately my battery started draining too much. When I go to sleep (about 8-9 hours) it's decreasing by 10%. Of course everything is off then (no WIFI/LTE, location, scanning whatever).

When using WIFI or LTE the decline is serious (the Android battery graph shows a sharp decline). I don't use the phone that often so screen on time is pretty low.

Here is a dump file from the night. Charged to 100% and woke up to 90% (I usually wake up with 96-97%).

I'm not using any app that is known to cause these issues (like Facebook) so I don't understand what the problem could be.

Thank you!
[BetterBatteryStats] Portgas D. Ace:
Alarms: 7, Intent: CONTEXT_MANAGER_ALARM_WAKEUP_1668285 -> this is a known drainer. You could use Amplify (an Xposed module) to tame it, but Xposed isn't available for Android 7.1.1 yet.

Beside this, I don't see anything that would justify the drain. But when having a closer look, 0.9% battery drain per hour isn't that uncommon, I saw higher ones. But as you have achieved better results in the past, this is high, yes.

I am afraid I am of no further help here. One last idea: did you update any app recently? Or did your Play Service performed a self-update? Maybe it is related to Play Services.
[BetterBatteryStats] TheeWolf:
Thank you!

This wakelock - is it safe to disable it?

About the apps - I always update apps (manually, I like seeing the change logs). Play services is really known for battery drains so it could be the reason, but I can't really tell if it's been updated (I just don't know).

Random question, as I looked in the file I saw the camera mentioned. I am using some camera mod (https://xdaforums.com/nexus-5x/themes-apps/mod-google-camera-4-2-nexus-5x-android-t3477980), could it have any effect?
[BetterBatteryStats] jpt19:
Increased drain the last few weeks

My Galaxy S5 mainly sits idle, and I used to get 7-8 days life per full charge. :)

The last few weeks I have been getting 2 days per charge. :( It happened very suddenly, not gradually over time, so I suspect some system update was the cause.

I tried a complete phone wipe 3-4 days ago, but the same drain exists.

Here is a log.
[BetterBatteryStats] githyanki:
Have you given root access to BBS? Your log is missing most all data.
[BetterBatteryStats] Portgas D. Ace:
Well, this alarm can't be disabled in any way, it is created by Google Play Services randomly. If you limit it, another one with a different number will appear. Amplify offers a regex function (basically a template to limit alarms which follow a specific pattern) for this.

Camera mods should not drain any battery. I haven't found anything in your log that would make me think that the camera mod drains battery.
[BetterBatteryStats] ainurrofiq:
Is there an app like amplify on nougat?
[BetterBatteryStats] Portgas D. Ace:
Haven't found any yet.
[BetterBatteryStats] ainurrofiq:
Okay so I'll try to love with these play service wakelock :D
[BetterBatteryStats] gorandroid:
What is this¿ is this causing my battery drain?
[BetterBatteryStats] gorandroid:
Dump is also here:
[BetterBatteryStats] Portgas D. Ace:
Most likely the drain is caused by Facebook, Facebook Messenger and Instagram, also partially by Google Play Services. Can't say for sure as the "alarm" stats in your log are incomplete, but as the above named apps are known to cause drain, this is my best bet. Beside this, 0.7% per hour idle drain is quite good.
[BetterBatteryStats] gorandroid:
I forgot to mention that the battery is 3+ years old :p
[BetterBatteryStats] Portgas D. Ace:
In this case, 0.7% per hour is just amazing :good:
[BetterBatteryStats] gorandroid:
Yea but i will most likely get a new battery coz I'll keep this phone for now :good:
[BetterBatteryStats] Icetea:
maybe this question was answered at the last 3170 pages, but i have no time to read them all:D

hope somebody will be kindly enough to answer my question .:fingers-crossed:

Shall i protect battery stats against battery optimization (doze mode) on MM systems too?
[BetterBatteryStats] jpt19:
This is a corporate device, and I am not allowed to root the device. My company access on the phone would be automatically revoked.
[BetterBatteryStats] swallowingled:
No, this is not needed. You should be fine with it optimized.
[BetterBatteryStats] githyanki:
Okay, but bbs needs root access. There are instructions for installing on non rooted devices, but I have not done this and cannot tell you how useful it hard it is.

The stats you got on your last post are useless for any troubleshooting issues.
[BetterBatteryStats] jpt19:
OK, thanks for the help.

I will look into whether BBS can be installed on non-root device (well technically, i already have it installed. but, I guess I need to find out how to configure it on a non-root device).
[BetterBatteryStats] h_maharaj:
Read post #4 in this thread. Chamonix provides instructions for giving the necessary permissions on non rooted devices using adb.
[BetterBatteryStats] Icetea:
short answer: YES it works on non rooted devices if you use the "adb -d ...." command. Tried it two times and it work as expected!
[BetterBatteryStats] Niakr1s:
Hello, I have a wild amount alarms WifiConnectivityManager Schedule Periodic Scan Timer, every 2-3 minutes on nougat based roms only. Turned off notifications about new Wi-Fi networks, and search for Wi-Fi in the location settings. Can someone with nougat ROM look in BetterBatteryStats, is it only my problem or? It's under alarms-Android. On marshmallow these alarms never was happened. Still is there somewhere where I forgot to turn off the function associated with Wi-Fi scanning? Thank you in advance.
[BetterBatteryStats] mnhs1010:
Battery Life Problem

HTC 10 2.41.401.4 Fw

Rom viper 5.3

when i wnet to sleep it was 65% and at morning mobile was off 0% zero battery life..

Please help to solve this problem.