yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ahikmat:
Wakelock Detector Version 1.5.6

[New version of Wakelock Detector has been released]

Unfortunately, the problem with 4.4 KitKat has not been solved yet, We need to dig more and wait for positive responses from Google.

In worst case, Wakelock detector will be separately released for 4.4 with limited features (Google closed so many doors..)

..

New Version includes these features:

# Integration with Greenify, now you can directly Greenify your apps from WLD (Big thanks to Oasis Feng for collaborating with us!)

# New Disc Widget which also includes screen-on time (Blue for screen-on)

# Knowledge base entries reached to 42! (NlpWakelock was also included )

# Option for refreshing widgets on touch

more:

# Improved the old widgets

# Minor bug fixes (There was a bug for some phones with GoogleIt feature)

# UI improvements

#Note

Wakelock Detector currently works with Greenify version 1.97 beta and above
[Android Apps and Games] User_99:
Thx for v 1.5.6

Found a small glitch in German translation: Change 'Kernel wakelock' -> 'Kernel-WakeLock'

Thx :thumbup:
[Android Apps and Games] ahikmat:
Check the attachment,

If you have Greenify v1.97 and above, then the button "Greenify" appears on the expanded view.
[Android Apps and Games] SecUpwN:
No way. AWESOME! Thank you so much [MENTION=4376588]oasisfeng[/MENTION] and [MENTION=2813077]ahikmat[/MENTION]! ;)
[Android Apps and Games] Christiancs1969:
http://xdaforums.com/showthread.php?t=2519744

[XPOSED MODULE][MOD] Enable BATTERY_STATS In KitKat
[Android Apps and Games] ahikmat:
After the recent Google's update for KitKat 4.4, I am discouraged and disappointed with Google's actions against developers.

I think "wakelock" info must be available for all Android users, because it is their property. They should be able to know what is happening to their phone while they are not using it.

Until KitKat the apps like BBS, Gsam and WLD gave users all these detail statistics from Google's hidden battery statistics repositories.

But starting from KitKat, they completely restricted it. Only the ROOTed users might be able to see the wakelock statistics for now. They might even disable it also in the future.

I wrote email to the person who did this. But no effect.

...

I have some idea about organizing a public Online(or maybe offline) demonstration against the Google's restricting developers and users from their freedom of knowing the detail battery statistics.

Maybe it sounds dumb, but we could join all together and do something against Google's change.

There are millions of users who resolved wakelock issues and doubled their battery life, who saved their phone from resetting or doing all costly things.

We can use famous social networks like a facebook page, or Google Plus page then

post our demands until we reach Google.

What do you think ? How much are you eager to support this idea.
[Android Apps and Games] CE20934:
I'll support it.
[Android Apps and Games] sonwon:
support!!!
[Android Apps and Games] spinosa:
Good idea. I'd call the campaign something like "Google Being Evil' and explain in the first line that, at the very least, they are being callous.
[Android Apps and Games] SpyroDazee:
To Reddit!
[Android Apps and Games] ahikmat:
Excellent idea!!

I will work on the contents,,
[Android Apps and Games] ahikmat:
I got a reply from "Dianne Hackborn" who commited the change

Hi Uzum,

This was never available to third party applications anyway -- the only APIs to access the information protected by it are all hidden, and change across platform versions. Any applications using these private APIs are going to break sooner or later, and we would rather it was sooner.

So I send her reply again, if it does not work, then we will try to catch public attention :)

Dear Dianne Hackborn,

Thanks for your reply.

We thought over about your reply,

However,

Could you consider discussing about reverting BATTERY_STATS permission's protection level from "android:protectionLevel="signature|system" to "android:protectionLevel="dangerous"

We could not find any solution for this issue, Our app can not access wakelock statistics without ROOT, and we don't want to force our users to ROOT their devices.

As users are aware that third-party app is going to access battery statistics,in our opinion this permission can not hurt the user . It just only gives access to power consumption information. We do not see any danger in this.

We are aware that this battery statistics API was hidden, we used reflection to access this info as that was the only choice.

Standard android battery app is good enough, however many users with "no-sleep" issues could not solve their battery draining issues with standard app. Because android's standard battery app does not give detail information.

Fortunately, they found "BBS" or "Wakelock detector" or "GSam battery monitor" and easily found out which rogue apps kept their phone awake from deep-sleep that were causing drastic battery drain.

They need this "wake lock" statistics. That is why there was a big demand for such apps.

In other words, Google is taking away the right from users to see their detail battery statistics.

For understanding how much serious problem is "no-sleep" issue, please take a look below links:

https://www.google.com/search?q=android+no+sleep+issue&oq=android+no+sleep+issue

http://software.intel.com/en-us/articles/wakelocks-detect-no-sleep-issues-in-android-applications

According to research paper, almost 50% of apps had this "no-sleep" bugs in 2012.

Hopefully, that number dropped by 2013, but still there are apps which mis-use "wake lock" feature and cause drastic battery drain.

Please check out the user feedbacks in "Wakelock detector" for more details.

Since 2013.03.01 We were happy to serve Android users by helping them to resolve their wakelock issues.

They doubled their battery life without going to A/S or Resetting their phones.

Right now, We need your help to help our users which are your users in turn.

Please Help!

Regards UzumApps
[Android Apps and Games] Ashin:
Why can't we just use root to change permissions or just read the stats?
[Android Apps and Games] Magissia:
And how do you do on devices without known flaws to get root? Root should be left to power users, having a device that doesn't die after 5 hours shouldn't be reserved to power users though.

Regards
[Android Apps and Games] ahikmat:
We came up with a solution for KitKat with non-rooted phones,

however, the procedure of using WLD is going to change:

1) Run WLD on your phone

2) Connect your phone to your PC (for Windows users; make sure you have USB drivers installed)

3) Run "WLD_Helper" app on your pc (this app is under development)

4) Unplug from USB, and enjoy wakelock statistics

After that you can use WLD like before,

however, if you restart your phone you got to repeat the above procedure (phone settings resets at reboot)

What do you think?

Would you just ROOT your device ?

or would you follow this procedure to solve your wakelock problem?
[Android Apps and Games] XDAMaxe:
I think most users of wld have rooted their phone (me too) so I don't bother to have root as a requirement to avoid this (annoying) procedure.

As far as I understand wld is a (the) utility to check for wake locks but next step is eliminate the unwanted wakelock(s) and that's more difficult if you don't want to simply uninstall an app (which is ultima ratio but often not desired or not possible because you need the apps features/aims). In detail the countermeasure often/maybe needs root (in case you must disable certain services or permissions producing wakelocks, ie with System Tuner or Disable Service or similar apps which all need root).

So finally with wld you will get information but with root you will be able to 'kill' the explored wakelock with countermeasures.
[Android Apps and Games] chamonix:
I you would like to look into implementing as a system app to regain battery_stats perms for rooted users (and avoid parsing dumpsys output and expensive su operations) I have a running and tested implementation for BBS. The repo is up-to-date
[Android Apps and Games] ahikmat:
Thanks a lot!

I will check it!
[Android Apps and Games] Ruta89:
Hi guys, before asking I want to thanks the creators of this app because I think it is wounderful!

So I tell you my problem: I am the owner of an Ascend P1 Huawei and I am running a stock firmware not officially released from the constructor but it is a stable version.

It never goes in deepsleep except when it is on plane mode so I started to search some solution and I founded your app.

It gives me a result of about x1200 wake call from AlarmManager and Android OS with the most percentual of battery drain.

After that I've tryed to access the AlarmManager.txt o AlarmDump.txt but probably the indications that I found on the differents threads on this forum doesn't work with my phone.

So anybody can help me to access this file? I need it to understand wich application of the system is keeping awake my phone.

P.S.: When I got these results I had a factory resetted phone so I had no app and I didn't make calls or data connection.

Thank you so much for the help!

EDIT: I've got the files I was looking for, someone can help me to understand where is the problem
[Android Apps and Games] dreamland2000:
Aside from the dirty fix to get this app working on 4.4 is there a more permanent fix? When I open the app I get a message saying 'failed to perform this task, try again later'

Tried clean install, wiped data etc but nothing works.

Thanks
[Android Apps and Games] shadrach47:
Nvm, ignore. Blind for not see the xposed module a few pages back.
[Android Apps and Games] munchy_cool:
so I installed the app on rooted Kitkat but it aint working, does it needed to be updated for KitKat users with root access as well? I know it's mentioned on Play Store it doesn't work with KitKat, just double checking.
[Android Apps and Games] munchy_cool:
writeup

Just did a small writeup on the battery stats api blocked

http://androidnews.co.in/2013/11/27/google-revokes-access-battery-stats-api-android-4-4-kitkat-causing-battery-stats-app-stop-working/
[Android Apps and Games] ahikmat:
Thanks,

let us hope for the best!
[Android Apps and Games] munchy_cool:
Try email AP and DL and phandroid ..maybe they publish it ....my site is new and maybe the post goes unnoticed ...
[Android Apps and Games] ahikmat:
We are trying to make WLD work with non-rooted phones,

there is one, but we've got to make steps as simple as possible.

we will release the fix for both rooted and non-rooted phones together,

that is why. we ask users to be more patient .

Thank you
[Android Apps and Games] polobunny:
Xposed + Enable BATTERY_STATS In KitKat module.

http://xdaforums.com/showthread.php?t=2519744
[Android Apps and Games] gordito_gr:
I need some help reading the stats properly.

In this pic AudioOut_1 is waking up the phone 2.48m in total or 2.48*3 times= almost 9minutes?

I think it shows total time, but i have to make sure
[Android Apps and Games] ahikmat:
No, 3 times is included inside 2.48 minutes.

"AudioOut_1" is related to sound, music players acquire this wakelock to keep cpu awake while playing.

In your case, you listened to "8Tracks" for 2.48 minutes.

everything looks okay from your screenshot
[Android Apps and Games] gordito_gr:
Τhank you for the info, its not my screenshot, its jsut some random i found online!
[Android Apps and Games] stagius24:
How do you make it to work? I tried with version 1.56 and activate the module but it still doesnt work
[Android Apps and Games] LLStarks:
The module works

Lets me use WLD with Galaxy S3 running CM11
[Android Apps and Games] chrisrozon:
Is the app available to sideload? I understand not opening it up on the Play Store, but I'm curious to try out the Xposed module.
[Android Apps and Games] stagius24:
The dev make it not compatible on 4.4 so you wont find it on playstore.

I download it from aptoide store. Or I am sure you will find it if you google.
[Android Apps and Games] chrisrozon:
Yup, found it last night and it's working perfectly.
[Android Apps and Games] ahikmat:
testing for kitkat

Wakelock detector 1.5.7, supports KitKat (rooted, also for non-rooted phones with few steps)

New permission added:

[INTERNET] - WLD does not consume any traffic, this permission is needed for adb self connection purpose

([BOOT] - this permission will be added for calculating screen on time for non-rooted kitkat phones)

Starting from kitkat we retrieve wakelock stats from "dumpsys", that is why your phone either needs to be ROOTED or you need to have adb access to your phone itself.

KitKat owners with ROOTED phones

Run WLD, allow ROOT at first run. It is preferred to check "remember it" option

KitKat owners with NON-ROOTED phones

This option takes few steps to accomplish, but this is the only way to see wakelock stats for non-rooted kitkat phones.

In android phones, by default adbd listens to USB port, we need to change it to listen tcpip for establishing adb connection.

for that we need to run "adb tcpip 5555" from PC. For Windows OS, usb drivers need to be installed. http://developer.android.com/sdk/win-usb.html

Install one of these light adb on your PC:

Windows: http://xdaforums.com/showthread.php?p=42407269

Mac/Linux: https://code.google.com/p/adb-fastboot-install/

Enable "developer option" on your phone (it is in settings window , if you don't see it click "Build version" 7 times on "About" section)

Run "adb tcpip 5555" from command line.

Then install "Terminal emulator" on your phone and run "adb kill-server" , "adb devices" and confirm self-connection.

You can follow these slides for details: https://docs.google.com/presentation/d/1r3VlhZIZVSufZlAeICJet6QBtyAF7z06_ysl1kUKME4/edit?usp=sharing

We are working to make single-click PC app.

If you could have better idea to optimize these steps, share it with us! Thank you!

[updated apk]

Big thanks to Sordna for helping to improve WLD and RootTools performance!
[Android Apps and Games] User_99:
Thx for the update. Found again the small glitch in German translation: in Statistics menu "kernel wakelock" should be ' Kernel WakeLock' in German. Sorry to bother you again about that ;)
[Android Apps and Games] ahikmat:
thank you,

done!!
[Android Apps and Games] ppaasseeii:
Working good so far on Nexus 4, 4.4, rooted.

Tested the greenify shortcut as well.

Good job!
[Android Apps and Games] munchy_cool:
working fine on android 4.4 gummyrom , gs4 rooted
[Android Apps and Games] berryman13:
Awesome to see a 4.4 version!!! Running fine on my gs3
[Android Apps and Games] Jolest:
Android 4.4 on an S3? What rom?
[Android Apps and Games] apsuva:
my phone never goes to sleep. I tried factory reset and wipe cache but it didnt work. pls help
[Android Apps and Games] EP2008:
I love this app, but is there any way to add an option to show stats "since screen off" so I can see what's using wakelocks when the screen is off, rather than since it was last charged?
[Android Apps and Games] tfouto:
As far as i understand, WakeLock Detector dont use any battery at all, right, on the background? It just collects Android stats. Is this correct?
[Android Apps and Games] ahikmat:
yes, that's correct!
[Android Apps and Games] gordito_gr:
3000 wakeups from networklocationlocator!!

Is that normal?

Its not spending so much time, but 3000 wakeups? Isnt that much?

I have a zooper widget that displays my location's name, is it normal to create so many wakelocks?
[Android Apps and Games] ahikmat:
thanks for an excellent idea!

this option tells users exactly what apps used wakelock while screen was off.

it is possible to add this feature, but from UI perspective we got to think about how smoothly users can adapt it.

we might add a new check-box on the bottom of "Since USB unplug"...
[Android Apps and Games] ahikmat:
Go to "Settings" and turn on "Advanced mode", now you can see more info about wakelocks related to Android OS

you can also check for "Kernel wakelocks"
[Android Apps and Games] ketani73:
In WLD settings , there is an option of "Upgrade" .....What's that ??
[Android Apps and Games] sordna:
let's star the issue !

Looks like the issue of BATTERY_STATS taken away from apps, is reported here:

http://code.google.com/p/android/issues/detail?id=61975

Let's all star the issue to undo that change! More than 700 people starred the issue already.

While you're at it, please also star the issue of gps indicator not flashing anymore while acquiring satellite lock:

http://code.google.com/p/android/issues/detail?id=62634

another downgrade brought by KitKat :(
[Android Apps and Games] ahikmat:
"Upgrade" unlocks additional features like Widgets and 'Knowledge base'
[Android Apps and Games] jatink007:
I tried on nexus 4 kitkat 4.4.1. Didnt seem to work :(
[Android Apps and Games] AA1973:
Wakelock Detector is running fine with Xposed framework and the "enable battery stats on kitkat" module.

GALAXY NOTE N7000 // KITKAT 4.4.1 // OMNI
[Android Apps and Games] jatink007:
I dont exactly know what Xposed framwork is...i googled it though....its not working on stock and i dont wanna mess with it right now
[Android Apps and Games] AA1973:
You'll need root for it to work. But that's not part of the thread. WLD is working on kitkat while using Xposed and the module I mentioned.

Added. Seamless integration of WLD with Greenify Donate. Works perfectly.

GALAXY NOTE N7000 // KITKAT 4.4.1 // OMNI
[Android Apps and Games] Restorer:
Anyone managed to get 1.5.7 working on a non-rooted device? I followed the instructions for non-rooted on a Nexus 4 on 4.4. tcp/ip connection sets up and works fine but no matter how long it's left, WLD just reports "There are no available battery statistics yet, give it some time!". Is there some way of testing if the app is actually managing to access dumpsys?
[Android Apps and Games] amanosz:
Seconding this. I installed 1.5.7 on my non-rooted Moto X, activated tcpip 5555, and it's been reporting "There are no available battery statistics yet, give it some time!" even after 6 hours. I am new to android so I'm not sure what to expect with this program.
[Android Apps and Games] sordna:
what did the rooted WLD do to my phone ?

Hi, I checked the SuperSU logs, and I see WLD doing some scary things every time, like mount my root partition read-write and mess with my init.rc ! Why? Can you please explain all the changes that the new WLD does to rooted phones, and how we can undo them ? Will these changes break OTA updates ? I thought the app will simply run dumpsys with root access, not do all these things on my phone without asking me. Here's the SuperSU log of my 2nd run of WLD. By the way I rebooted by phone and still my / is mounted read-write :(

echo Started
ls /data/local/tmp

echo F*D^W@#FGF 0 $?
mkdir /data/local/tmp

echo F*D^W@#FGF 1 $?
bugreport-2013-05-18-23-34-37.txt.tmp
init.rc
F*D^W@#FGF 0 0
mkdir failed for /data/local/tmp, File exists
F*D^W@#FGF 1 255
busybox mount -o remount,rw /rootfs /
toolbox mount -o remount,rw /rootfs /
mount -o remount,rw /rootfs /
/system/bin/toolbox mount -o remount,rw /rootfs /

echo F*D^W@#FGF 2 $?
F*D^W@#FGF 2 0
chmod 0777 /init.rc

echo F*D^W@#FGF 3 $?
dd if=/init.rc of=/data/local/tmp/init.rc

echo F*D^W@#FGF 4 $?
chmod 0777 /data/local/tmp/init.rc

echo F*D^W@#FGF 5 $?
F*D^W@#FGF 3 0
38+1 records in
38+1 records out
19672 bytes transferred in 0.002 secs (9836000 bytes/sec)
F*D^W@#FGF 4 0
F*D^W@#FGF 5 0
ls /sbin/su

echo F*D^W@#FGF 6 $?
/sbin/su: No such file or directory
F*D^W@#FGF 6 1
ls /sbin/su

echo F*D^W@#FGF 7 $?
ls /system/bin/su

echo F*D^W@#FGF 8 $?
/sbin/su: No such file or directory
F*D^W@#FGF 7 1
/system/bin/su: No such file or directory
F*D^W@#FGF 8 1
ls /system/bin/su

echo F*D^W@#FGF 9 $?
ls /system/xbin/su

echo F*D^W@#FGF 10 $?
/system/bin/su: No such file or directory
F*D^W@#FGF 9 1
/system/xbin/su
F*D^W@#FGF 10 0
ls /data/local/xbin/su

echo F*D^W@#FGF 11 $?
/data/local/xbin/su: No such file or directory
F*D^W@#FGF 11 1
ls /data/local/xbin/su

echo F*D^W@#FGF 12 $?
ls /data/local/bin/su

echo F*D^W@#FGF 13 $?
/data/local/xbin/su: No such file or directory
F*D^W@#FGF 12 1
/data/local/bin/su: No such file or directory
F*D^W@#FGF 13 1
ls /data/local/bin/su

echo F*D^W@#FGF 14 $?
ls /system/sd/xbin/su

echo F*D^W@#FGF 15 $?
/data/local/bin/su: No such file or directory
F*D^W@#FGF 14 1
/system/sd/xbin/su: No such file or directory
F*D^W@#FGF 15 1
ls /system/sd/xbin/su

echo F*D^W@#FGF 16 $?
ls /system/bin/failsafe/su

echo F*D^W@#FGF 17 $?
/system/sd/xbin/su: No such file or directory
F*D^W@#FGF 16 1
/system/bin/failsafe/su: No such file or directory
F*D^W@#FGF 17 1
ls /system/bin/failsafe/su

echo F*D^W@#FGF 18 $?
ls /data/local/su

echo F*D^W@#FGF 19 $?
/system/bin/failsafe/su: No such file or directory
F*D^W@#FGF 18 1
/data/local/su: No such file or directory
F*D^W@#FGF 19 1
ls /data/local/su

echo F*D^W@#FGF 20 $?
/data/local/su: No such file or directory
F*D^W@#FGF 20 1
dumpsys batterystats --checkin

echo F*D^W@#FGF 21 $?
7,0,i,uid,1000,com.android.settings
7,0,i,uid,1000,com.android.providers.settings
7,0,i,uid,1000,com.android.inputdevices
7,0,i,uid,1000,android
...
[Android Apps and Games] ahikmat:
Hi,

There is a better manual to follow with more details,

https://docs.google.com/presentation/d/1r3VlhZIZVSufZlAeICJet6QBtyAF7z06_ysl1kUKME4/edit?usp=sharing

can you try to follow, and let us know if you succeed
[Android Apps and Games] ahikmat:
Try to follow these slides to run WLD on non-rooted kitkat phones

https://docs.google.com/presentation/d/1r3VlhZIZVSufZlAeICJet6QBtyAF7z06_ysl1kUKME4/edit?usp=sharing
[Android Apps and Games] ahikmat:
Try to follow these slides:

https://docs.google.com/presentation/d/1r3VlhZIZVSufZlAeICJet6QBtyAF7z06_ysl1kUKME4/edit?usp=sharing

and let us know if you succeed
[Android Apps and Games] ahikmat:
I am using library called RootTools, i will check if there is a problem with it
[Android Apps and Games] Thomas_BA:
Well on my Moto X rooted it won´t be able to mount the root partition, etc. as i do not have the write protection eliminated.

Will this have any influence regarding the results WLD is showing?
[Android Apps and Games] sordna:
Thanks. I see several problems with it:

1. It mounts the root partition read-write (bad thing), and leaves it writeable!

2. It does: chmod 777 /init.rc (extremely insecure, making it editable by any app on the phone) then copies init.rc to /data/local/tmp

It does not need to chmod the file, neither mount the root partition read-write, because as a rooted app it can already read and copy the file since the /data partition is writeable. So why the mount and chmod business!

3. It looks for "su" in a gazilion places. Even after it finds it in the usual place: /system/xbin/su it keeps looking. This is very inefficient... the following link is very enlightening on how to invoke su: http://su.chainfire.eu/#how

4. It does the same stuff over and over every time you run WLD ! It's a huge security issue if it makes your root and your /init.rc writeable on every run, and totally unnecessary. I downloaded RootTools and saws these things in RootToolsInternalMethods.java :(

Anyway, I was able to bring my phone back to previous state as far as I can tell, but since you only need to do a simple dumpsys, I think you may not need RootTools and simply follow the chainfire link.

By the way, maybe another option for you is to make WLD a system app, App Ops X uses this method (installs itself in /system/priv-app) and as a system app gains access to app ops, which like BATTERY_STATS, KitKat took away. So maybe that method might work for WLD, otherwise a simple su call should work without extra libraries.

Anyway I love WLD, and will be glad to test future versions to help get these issues ironed out! Thank you!
[Android Apps and Games] jatink007:
I tried it again. Got to enable tcpip 5555 via PC but unable to get Adb self connection using terminal emulator on the phone. I am on android 4.4.2
[Android Apps and Games] ahikmat:
what does it say?

did you get confirmation dialog after running "adb devices" ?
[Android Apps and Games] ahikmat:
Thanks for recommendation!

We will go with static RootTools instance in the beginning, and then change it in the future.