1. seanubis's Avatar
    Just wanted to share a tip I found while investigating severe battery drain on my 2013 Moto X.

    Over the past few weeks, the battery life on my Moto X was horrible - I could get maybe 10 hours off the charger, with minimal screen-on time, like well under 90 minutes.

    I noticed from the battery graph that something was keeping the phone awake all of the time. I looked into using a wakelock detector app, but every one I found seemed to require root, which I don't have (4.4.4 on VZW).

    I finally found this thread on Reddit, that showed how to get wakelocks through adb shell, like this:

    adb shell dumpsys power | grep -i partial_wake_lock

    Running that in a loop revealed the culprit:

    $ while true ; do adb shell dumpsys power | grep -i wake_lock; sleep 1; done
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    PARTIAL_WAKE_LOCK 'handleMediaEvent' (uid=1000, pid=909, ws=null)
    ...


    I googled "handleMediaEvent" and found this XDA thread that suggested that it was a problem related to Bluetooth playback controls, and that power cycle was the only way to get things back to normal: http://forum.xda-developers.com/show....php?t=2483630

    Sure enough, I power-cycled and now my phone is sleeping when it should.

    Hope this helps someone else - it sure helped me. Thanks, internets!
    sixty_four likes this.
    06-15-2015 12:22 PM
  2. titetanium's Avatar
    Found what? Don't hold out on us, please.

    Sent from my C525c using Tapatalk
    06-15-2015 12:33 PM
  3. seanubis's Avatar
    Found what? Don't hold out on us, please.
    Not sure what you mean. Everything I found is in the post.
    06-15-2015 12:35 PM
  4. ajkam's Avatar
    Found what? Don't hold out on us, please.

    Sent from my C525c using Tapatalk
    I had to open this post in a browser or the AC app to see the rest of the post.
    06-15-2015 05:59 PM
  5. seanubis's Avatar
    I had to open this post in a browser or the AC app to see the rest of the post.
    Must be some kind of Tapatalk weirdness.
    06-15-2015 07:43 PM
  6. seanubis's Avatar
    Must be some kind of Tapatalk weirdness.
    Yep, seems Tapatalk didn't like the XDA link. I've reformatted things a bit, should load completely now.
    06-15-2015 07:48 PM
  7. sixty_four's Avatar
    Yep, seems Tapatalk didn't like the XDA link. I've reformatted things a bit, should load completely now.
    Very handy! Thanks for posting this. I'm dumping results to a file so I can filter and look at the results after a good amount of time has elapsed.

    One thing I've noticed is "aon_charging" constantly generates partial wakelocks. This looks like something that's associated with Moto's Active Display. If I had to guess this might be the reason why the battery graph shows my phone as always awake when it's connected to a power source.

    I don't know if there's a way either to use adb without a USB connection or to disable USB power so I'm kind of in a Schrodinger's Cat situation where I wish I could see what my "real" wakelocks look like but can't do that without influencing the results by observing
    06-16-2015 12:41 AM
  8. seanubis's Avatar
    Very handy! Thanks for posting this. I'm dumping results to a file so I can filter and look at the results after a good amount of time has elapsed.

    One thing I've noticed is "aon_charging" constantly generates partial wakelocks. This looks like something that's associated with Moto's Active Display. If I had to guess this might be the reason why the battery graph shows my phone as always awake when it's connected to a power source.

    I don't know if there's a way either to use adb without a USB connection or to disable USB power so I'm kind of in a Schrodinger's Cat situation where I wish I could see what my "real" wakelocks look like but can't do that without influencing the results by observing
    You could filter out the "aon_charging" entries with grep in real time, eg:

    while true ; do adb shell dumpsys power | grep -i wake_lock | grep -v aon_charging; sleep 1; done

    Hope that helps!
    06-16-2015 12:45 AM
  9. sixty_four's Avatar
    You could filter out the "aon_charging" entries with grep in real time, eg:

    while true ; do adb shell dumpsys power | grep -i wake_lock | grep -v aon_charging; sleep 1; done

    Hope that helps!
    Yep - I'm just tee'ing the output to a file and filtering after the fact. Just like digging through polluted syslogs at work
    seanubis likes this.
    06-16-2015 10:59 AM

Similar Threads

  1. Replies: 9
    Last Post: 07-19-2015, 02:01 PM
  2. HTC one x root
    By Brandon Bruce1 in forum Ask a Question
    Replies: 1
    Last Post: 06-18-2015, 08:25 AM
  3. Can I get some general direction for my first root?
    By AC Question in forum Ask a Question
    Replies: 1
    Last Post: 06-15-2015, 04:32 PM
  4. Replies: 1
    Last Post: 06-15-2015, 03:47 PM
  5. Replies: 1
    Last Post: 06-15-2015, 12:13 PM

Tags for this Thread

LINK TO POST COPIED TO CLIPBOARD