yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
Yea. The last test I have to make is to see if the encrypted app as you get from gplay acts the same and does not prevent me from solving the sstem-app problem. I guess I will upload a test version tomorrow and try it out. If you want to test please feel free to drom me a PM with your email address so that I can whitelist you on gplay.
[BetterBatteryStats] mag01:
[MENTION=1330150]chamonix[/MENTION]

I've found one more issue, so far it seems to be like the following:

- BBS installed only as user app (not really important in this case I think but it's how I tested it), root features disabled (to avoid granting it prematurely)

- It's either after application update (from previous RC4 for example), or removed from the SuperSU (1.75) application list (e.g. it's updated - if reauhorization is enabled in SuperSU - or completely new to SuperSU), also it seems it can be reproduced if it's known to SuperSU, but configured to popup a SuperSU prompt

- start BBS, go to settings / advanced / system app

- it will badly hang for about a minute or two, I'll be given several prompts that it doesn't respond and whether I want to kill it, when letting it to continue running it will eventually cause an expected SuperSU popup to appear, then if I grant or refuse root it will continue operating as expected

Debug logcat and thread dump attached (the hanging thread seems to be Thread-237 which then causes the main thread to hang as well).

Time between 01:49:13 and 01:50:23

Note that in the case it's started with root features enabled, then the first root request after BBS start is quick (with the same SuperSU configuration and state). Only when it first requests root from the System App screen it hangs. So a hint for where to start is to check for differences between those cases.

Also when I check SuperSU log I can see several (about 4) requests for root coming (from BBS) at the same time (which is strange, because repeated attempts after BBS is granted root show just one request)- maybe the SuperSU is flooded a little and thus slow? With BBS root features enabled and first root request coming from the stats related activity there's just one root request at a time.

EDIT: Added logcat2-verbose.txt that covers just that hanging state in more detail (03:59:42-04:01:51).
[BetterBatteryStats] zekenka:
Any tips with this?

Phone: Samsung galaxy s2

Rom kit Kat

Location settings turned off
[BetterBatteryStats] gabriolinari:
wow as usual great info there Perseus.... actually i have stock 4.1.2 Rom and Dorimanx Kernel V 8.43 right now. you mean "location reporting" privacy setting or under the browser's settings?

strangely enough today i dont have many of those Partial Wakelocks on the list.... today i have this fab

CallerInfoCache

14m and 58s

all the rest seems good... misteries.

i will look more under "alarms" during the weekend.

thanks

Gab
[BetterBatteryStats] caplja:
thanks, I read it and now I understand it. But, to me I can se that my phone uses more power while this option of Zero Wake Lag is ON.

for example, I tested it this few days since then and my battery usage is about 3.6%/h on 24hrs time and before with going phone into the deep sleep it was abour 2.1-2.4%/hrs.

that is more then 30% in 1 day for same usage of phone and that is not useless.

Can you tell me how to turn it off?
[BetterBatteryStats] chamonix:
I have no idea, you should check the Q&A thread of the rom/kernel implementing that feature.
[BetterBatteryStats] caplja:
will do, I thought that this is the option of any other rom because I was for loong time on philz. Alo I have to notice that I got really huge amount of TIME_TICK wakeups since update.

Will ask in apolo kernel thread.
[BetterBatteryStats] chamonix:
Time tick is the internal clock and there is nothing to worry about that alarm
[BetterBatteryStats] chamonix:
New (and hopefully last before release) RC is up.
[BetterBatteryStats] caplja:
Yes, I know that and didn't worry about it as I saw he doesn't use any more battery. But I saw the difference between few kernels, on some time tick is present and on others not.

For me, the main wake-up is multipdp and secril_fd-interface and as the time_tick I just can't get rid of it even running the clean fresh install of rom with no apps installed. The standard ratio of deep sleep and awake time is 1:2.
[BetterBatteryStats] chamonix:
If you want to discuss potentials further please post a dumpfile. Alarms are one part of the equation but we need the full picture for making a proper analysis.
[BetterBatteryStats] mag01:
Those are related to Google Play Services, especially to the Google Cloud Messaging (GCM) functionality which is used mainly for messaging and retrieval of various notifications from external sources.

If you don't require any background push notifications stuff to work (for example many IM clients use that when running at background), you can block all the Google Play Services from automatic startup in a tool like Autostarts (requires root).

If you require it, you can at least block all of them except for com.google.android.gms.gcm.ServiceAutoStarter - that's the only one you need to keep running then. That will help, but only a little, because GCM will still run.
[BetterBatteryStats] caplja:
I tried by myself see the pattern and reduce the wakeups so I have it clean in txt. hope it is ok. This one is older but others are similar to this one.

multipdp and secril are the main wake up. If I use the phone 1hr of screen on in half a day, the awake time is 2hrs.

Have tried everything to reduce it. even format whole sd and ex-sd card, ut no luck.
[BetterBatteryStats] mag01:
That looks like disabling the fast dormancy would be essential, you may have a look here for some hints

http://www.androidnz.net/2012/06/at-your-own-risk-how-to-disable-fast.html

http://xdaforums.com/showthread.php?t=2025570

So in your case (GT-I9100) dialing this code should get you to the right place: *#9900#*

And there's also an app for more recent Samsung phones: https://play.google.com/store/apps/details?id=com.gokhanmoral.fastdormancytoggle.i9300
[BetterBatteryStats] caplja:
yep, I tried it. with or without fast dormancy turn on/off is the same.

I also check with my operator and they have fast dormancy enabled.
[BetterBatteryStats] mag01:
That's pretty strange, it should really make some difference. Did you also try that "data roaming trick"?

And was the phone fully restarted before checking the real difference?
[BetterBatteryStats] gaich:
RC5 is the latest in the list, although the changelog for RC6 is present.:cyclops:
[BetterBatteryStats] chamonix:
Sorry for that: fixed
[BetterBatteryStats] chamonix:
the main cause of awake is definitely data. As google's backends have been pretty unreliable these days I recommend that you keep an eye on it. Potentially and if you don't need it you could also disable the cloud backup to google to reduce the overhead when the backends do not work properly.
[BetterBatteryStats] caplja:
Didn't try roaming trick? Roaming is turned off in optiona, what trick you talking about?

Yes, the phone was fully restarted, difference is so small that I didn't even saw it. I have about 5-6 dumpfiles like this and in every one I try max as possible to have same conditions.

Only reason I use google for is gmail. In sync options everything is turned off, occasionally i turn on sync of contacts but that's all.

I don't use cloud backup or any other sort of backup expect titanium.

Also, I did try to have sync off and there is noticeable drop of that wakeups but I just can't be without mail. I tried other mail app expect gmail but the results are the same.

Of course, I don't have apps like Facebook, whatsup, viber etc. so that's even more interesting to me :/
[BetterBatteryStats] mag01:
[MENTION=1330150]chamonix[/MENTION]

RC6 still hangs on attempt to open the the system app screen.

It's as before, just if I haven't enabled "root features" before accessing the system app screen, it will hang, then after it resumes it will display the system app screen + notification that I should have root features enabled.

If I enable root features just before accessing the system app screen, then it will hang again and just won't popup that notification after it resumes.

Strange that requesting root from any of the the stats screen first doesn't cause anything such. Only here at the system app screen it causes these troubles.

Of course SuperSU must be configured to show the popup for BBS before trying to reproduce this.

log + thread dump attached, starting time 14:08:42

Now will check the system app stuff for Google Play installations.

EDIT:

Installing the Google Play version as system app doesn't behave correctly unfortunately:

1. install from Google Play

2. enable root features, install as system app, reboot

3. BBS disappears from the launcher, it can be only seen in the applications list in version 1.0.0.0 - that means it's that dummy system app:

$ ls -la /system/priv-app/com.asksven*

-rw-r--r-- root root 293766 2013-11-22 14:30 com.asksven.betterbatterystats_signed.apk

$ ls -la /data/app/com.asksven*

/data/app/com.asksven*: No such file or directory

EDIT: well it's actually placed here: /data/app-asec/com.asksven.betterbatterystats-1.asec and after 2 repetitions I ended up with 2 identical asec apps in there (/data/app-asec/com.asksven.betterbatterystats-1.asec and /data/app-asec/com.asksven.betterbatterystats-2.asec) - and this remains in place even after the system app is installed, however the unpacked version in /mnt/asec disappears after installing the system app

4. when I chose to uninstall updates (for that dummy system app) it will reappear in the launcher, but of course it's that dummy app, I can't uninstall this dummy app in this state, there's only an option to disable it

5. reinstalling from Google Play (in this state) will fix things and because I will have the system app already in place from previous attempt it will detect it alright.

6. in this state, it I uninstall the system app and restart then all goes well, the system app is gone and the main app remains in place. Also, uninstalling system app seems to have an effect on the app settings - they're lost.

Added bbs-11500rc6-systemapp-install-gplay.zip with log covering Google Play BBS install from clean state + first launch (with that hang again) + install as system app (after which the main app disappears)
[BetterBatteryStats] mag01:
I mean someone here: http://xdaforums.com/showthread.php?t=2025570 reports success reducing those wakelocks after enabling data roaming and restarting the phone. Yes, pretty strange, but may be worth giving a try at least.
[BetterBatteryStats] vectorgate:
Looks great
[BetterBatteryStats] chamonix:
As I said you may want to try disabling "backup". Even if I can tell if that alone is responsible for the traffic the number of wakelocks is pretty high and as the data volume is not the problem it may be an irresponsive backend.
[BetterBatteryStats] caplja:
aha, I was referring to sync. classic backup under backup&reset options is turned off as every other backup option from other apps. I'm using titanium for that kind of backup "safety".
[BetterBatteryStats] chamonix:
Thank you for testing that. From the logcat with the gplay signed app I see two things that bother me:

1)

11-22 14:53:15.540 I/AppOps ( 750): Pruning old package com.asksven.betterbatterystats_xdaedition/10086: new uid=-1

Just after boot something seems to have happened to the xda edition. I can't tell if that is related but could you possibly clean all the versions of BBS installed, including the system app and retry a whole cylce, provding a logcat after installing from gplay and before rebooting and one after the reboot. I am interested in seing when the apk from data gets deleted.

2)

11-22 14:56:34.075 W/zipro ( 750): Unable to open zip '/system/priv-app/com.asksven.betterbatterystats_signed.apk': Permission denied
11-22 14:56:34.075 D/asset ( 750): failed to open Zip archive '/system/priv-app/com.asksven.betterbatterystats_signed.apk'
11-22 14:56:34.075 W/PackageParser( 750): Unable to read AndroidManifest.xml of /system/priv-app/com.asksven.betterbatterystats_signed.apk
11-22 14:56:34.075 W/PackageParser( 750): java.io.FileNotFoundException: AndroidManifest.xml

Here it looks like something is trying to access the manifest and fails. I have to look closer into that as that action failing may finally result in now knowing what version the system app has. As there is a trigger deleting userland installed apps when their version is lower or equal to the one from the system directory that may be important.

Edit: There is still a bug in the system app screen causing the hang: even if I check the root features and show a popup the screens still refreshes below and the button showing the state (install / uninstall) makes a root call. I can't tell why SuperSU/User does not pop-up at that point but this call should not be made anyway. I have fixed that in the next RC that will be uploaded once we have had a closer look at the behavior when the app comes from glay
[BetterBatteryStats] mag01:
I did believe even the previous logs were from clean state, but it seems there were still some remains.

This time I really uninstalled both parts, checked /system/priv-app, /data/app-asec, /mnt/asec and also cleaned the bbs stuff from /data/dalvik-cache, rebooted, installed from GPlay, launched, installed system app.

Gathered logs after installing the system app (logcat5-verbose.txt), also added logs after restart (logcat6-verbose.txt).

I added few additional (maybe useful) notes to the previous report, but I added them quite late, so just to make sure you will get them:

- bbs from GPlay is installed in /data/app-asec and then unpacked to /mnt/asec

- after I install the system app, the bbs .asec file in /data/app-asec will remain in place, however the related /mnt/asec stuff will disappear (that's probably the reason it disappears from the launcher)

- when I'm in that state with system app installed and main app not visible in launcher, I reinstall the main app from GPlay, launch it and can normally use it

- then when I uninstall the system app, It's all fine (system app is uninstalled, main app remains), but after restart the bbs settings are gone and I have to set everything again
[BetterBatteryStats] Flash23:
I had a "cache update service" wake lock that was keeping my phone awake for 8+ hours... I wiped dalvik + cache from recovery and it fixed the problem...

I don't know where the problem was coming from but in case anyone having the same issue try wiping
[BetterBatteryStats] Perseus:
Reboot should Clear it. If not wipe data for Dialer.

Reboot and it would have gone too. Its the cached image from Carrier rolling out Stock update.
[BetterBatteryStats] Karpfenhai:
Just read a few pages back, I published a short guide how to disable gcm receiver.

Tapatalked from my Galaxy SII
[BetterBatteryStats] zekenka:
Yeah that's the thing everything is turned off, no sync, no location etc
[BetterBatteryStats] Perseus:
Four Square and Google Play Services is looking for Location. Please freeze both the apps and then turn off Location Service. Reboot and post a new log.
[BetterBatteryStats] dEris:
Don't I need Google Play Services? I will freeze FS and report back. Thanks.

[DEVICE : NEXUS⁴]❌[ROM : PSX]❌[KERNEL : FRANCO]​
[BetterBatteryStats] kosique:
Freezing Google Play Services is ok?
[BetterBatteryStats] Karpfenhai:
Did you disable these certain receivers??
[BetterBatteryStats] Perseus:
Yes its just fine. If you have Gmail issues, wipe the data for gmail then re-login to it.
[BetterBatteryStats] mag01:
[MENTION=1330150]chamonix[/MENTION]

Alright, enjoy the night with the PackageManager sources..

Just one note.. the stuff from /mnt/asec (/mnt/asec/com.asksven.betterbatterystats-1) disappears right after the system app installation, e.g. even before reboot.

So what's being logged after the reboot is probably some sort of "reorganizing" against the /system location, because /mnt/asec/com.asksven.betterbatterystats-1 doesn't already exist at this point so the /system is now probably the primary place where it exists (/data/app-asec location doesn't seem to play any significant role in this).

It's like:

1. install from gplay: /data/app-asec + /mnt/asec

2. install system app: /data/app-asec + /system/priv-app (e.g. /mnt/asec stuff disappears)

3. reboot, still the same as in 2.
[BetterBatteryStats] chamonix:
RC7 is up.
[BetterBatteryStats] chamonix:
Fix for that problem (hopefully) and for the blocking system app pref screen is up and has been pushed to gplay. If yould be nice if you could retest the whole cycle.
[BetterBatteryStats] ihatelolcats:
i somehow lost root access for this app, what do i need to delete to get it to ask for root again?

ah i asked too soon. its in advanced options. sorry
[BetterBatteryStats] caplja:
Tried tonight with that trick. As you can see, no luck.

Here it is from tonight. Every kind of back up turned off.
[BetterBatteryStats] mag01:
[MENTION=4754846]caplja[/MENTION]

Interesting, it's really still there. Your log shows the highest data transfer activity coming from the Zedge app, however as it also shows more than 10 minutes of screen on time, it could be that you just actively used it during that period. If that isn't the case, check settings of that app - if you can disable any background activities... eventually temporarily disable it before gathering next stats. Also next time try to gather stats that will have less screen on time.

It still shows a lot of fast dormancy related wakelocks tbough.
[BetterBatteryStats] caplja:
I have used that app to change alarm tone before going to bed:) Was using it for 90% of that screen on time I would say.

But, will do now the test for few hours with zero screen on time.

Now, I will turn romanig off.

Yes, and that's bother me the most. I have change few kernels, done full wipe, even format whole sd card and every time is same.

I also tried to install app by app after full wipe and not using titanium and still the same:(
[BetterBatteryStats] chamonix:
Sorry for the broken package on gplay, something went wrong in my build workflow.

I have fixed the following:

- ask for su rights right after enabling the root features

- hint the need to unistall the system app prior to uninstalling bbs (for now as a workaround, II have added a non urgent issue #434 for a more elegant solution allowing the system app to uninstall itself. I consider this as non urgent though as I could also provide a CWM package doing this work if the support request in that issue raise above a tolerable number

RC8 is uploaded to gplay for testing.
[BetterBatteryStats] chamonix:
1.1RC8 is up
[BetterBatteryStats] chamonix:
Your awake/screen on ratio got better:

Awake (): 38 m 32 s (2312 s) Ratio: 6.3%
Screen On (): 12 m 32 s (752 s) Ratio: 2.0%

Could you please provide an idle dump (no screen on time) so that we can have a closer look at what the phone does when you do noting?
[BetterBatteryStats] chmun77:
Partial wakelock requires root permission now? So I can no longer see which are the apps causing the waklocks without rooting?
[BetterBatteryStats] rcsrich:
Just installed RC8 on Nexus 7 2012 with 4.4...
[BetterBatteryStats] jlmcr87:
[MENTION=1330150]chamonix[/MENTION] , as i say you xxhdpi icon is correct in size but the picture is not centered and smaller.:good:
[BetterBatteryStats] mag01:
[MENTION=1330150]chamonix[/MENTION]

- RC8 from Google Play is working again.

- Root features option requests for root immediately and it's quick, without it I can't get to the system app screen so that long blocking is eliminated that way (though it's still interesting that there are such differences in that behavior at different places :D )

- Installing as system app leaves the main app in place now. After installing I get a notification to uninstall the system app prior to uninstalling BBS. Yes that's good for now, it's just about covering that possible scenario somehow. Later you may introduce an independent uninstall feature for the system app itself so in the case it's left over, it can be still easily removed.

- Just when the system app is installed and then later uninstalled, application settings are lost. That's probably nothing you can do much about, as they both have the same package and that system app uninstall process simply wipes the application data.

Attaching logs covering

launch + setup + system app install (log 8)

reboot + launch + system app uninstall (log 9)

reboot + launch (log 10)

[MENTION=2272764]chmun77[/MENTION]

Root is required only at Android 4.4 KitKat and it isn't BBS fault.
[BetterBatteryStats] chamonix:
unfortunately yes and here is why: http://xdaforums.com/showthread.php?t=2529455
[BetterBatteryStats] chamonix:
Thanks for the time you have invested in testing. About the effect on prefs when the system app is uninstalled you are right, there is nothing I can really do about that but I'll add an info to let users know.

I will prepare the release package now and start making all the required changes to the doc and the gplay description. I will probably start a staged rollout for 50% of the users tomorrow, observe the rollout for one day and then go all-in on monday.
[BetterBatteryStats] BrhoomHD:
Any solution for audiomix issue ?
[BetterBatteryStats] caplja:
This is from 3hrs time log.

Since 3 h 6 m 32 s

Awake (): 12 m 5 s (725 s) Ratio: 6.5%

Screen On (): 12 s (12 s) Ratio: 0.1%

for me that's out of standard limits isn't it?
[BetterBatteryStats] chamonix:
That awake time is mostly caused by network traffic. As google still has backend issues (my phone tells me that sync is broken and currently unavailable) that's the best it can be for now knowing that you don't want to avoid using google cloud services completely.
[BetterBatteryStats] caplja:
I understand, so it is because of google/gmail. Is there way to use only gmail and mail with everything else shut down?

Will tray to log the same time now with sync off.
[BetterBatteryStats] chamonix:
Gmail make use of part of the google service framework, especially CDM. If you want to keep gmail but disable all sync you could use another IMAP mail client like kmail. Of course kmail will also have an overhead (push) and I can't tell you if that overhead would be les than gmail with its backend being faulty these days (under normal circumstances gmail with CDM is more effective than kmail).
[BetterBatteryStats] shadyabhi:
Hi Persues, this is regarding the sec-battery-monitor wakelock. (http://xdaforums.com/showthread.php?p=47662505#post47662505)

You can find the dump here: http://pb.abhijeetr.com/hWAj (It's for around 3.5 hours after a device restart)

It would be great if you guide as to what else can I do to find the root cause. Thanks
[BetterBatteryStats] mertzi:
Help! I'm clueless. Since yesterday i had android system keeping my nexus 7 awake for 12 hours and today i made a full charge and rebooted but it won't stop. I disconnected my charger 2 hours ago and already lost 10% because it won't go to deep sleep. Last week I had something similar happen because of Google play services but a reboot solved it. But now it doesn't work. How come it's almost always Googles own stuff that causes battery drainage and not 3d party apps. How can i troubleshoot this when bbs won't show partial wake locks in kit kat?

Today

Yesterday
[BetterBatteryStats] mag01:
[MENTION=4165538]mertzi[/MENTION]

It seems 1.15.0.0 will be out soon, probably tomorrow or a day later. It will be able to collect detailed stats at KitKat, but only if you're rooted (thanks to Google, see http://xdaforums.com/showthread.php?t=2529455 ).

So if you're rooted or are willing to root your device, you can then install it and collect some relevant stats. WIthout that it's difficult to find out what's the culprit in your case, you can perhaps target the basic usual suspects that are often mentioned here (location services, various unnecessary sounds, Google search hotword detection, various Google Play Services activities, GMail and other sync activities, WiFi network search for location purposes even when WiFi is off, also NFC/Android Beam), but there are of course much more - especially if you've installed many other apps that can perform some background activities.