1. Are you ready for the Galaxy S20? Here is everything we know so far!

Battery Life Test - Android OS

Discussion in 'Android Devices' started by Stigy, Dec 20, 2011.

  1. Stigy

    Stigy Some say...
    Thread Starter

    A developer over at XDA wants to try to figure this battery issue and high Android OS usage out so he asked me to make a post regarding a test he would like us to perform. Please follow the instructions below to help out -- the first part everyone can participate in and the second part requires root, but even if you are not rooted please help out.

    1. Reboot phone and charge to 100% or clear battery stats in recovery / bootloader.

      The user needs to clear their battery stats before they start the test. Either clear it in bootloader or charge to full, then unplug. People are starting at 78%, and AndroidOS is factoring in their other runtimes.
    2. Turn on Wifi (make sure "Always On" is set).
    3. Let the phone run idle with screen off (turn off background data if possible) for as long as you can. Even go watch a movie and leave your phone alone.
    4. If you get an urgent text or call that needs answering, try to let the phone go back to sleep for at least another hour or so.
    5. After this time has elapsed, please grab a screenshot of your Android OS usage (after clicked, showing Keep Awake time). Also note how much battery percentage you lost in this time.

    If you are rooted, please perform the following two steps after finishing the steps above:
    1. Load adb shell
    2. Run the following two commands as su:
      cat /proc/kmsg > kmsglog.txt
      cat /proc/interrupts > interlog.txt
      cat /proc/net/netstat > netlog.txt
    3. Grab these two log files and paste them into pastebin.com and then PM myself so I can forward them.

    Thank you for your help!

    Edit: If you are rooted, you can run the commands above from a terminal emulator but just type "cd sdcard" first since the / directory is not writeable. The three text files will then be in your SD card for emailing or pastebin'ing.

    dhworph and drbugsmn like this.

    1. Download the Forums for Android™ app!


  2. jkc120

    jkc120 Android Expert

    I will definitely give this a shot today or tomorrow. Probably tomorrow, as I'm in my 3rd initial charge cycle and I want that to go through fully before I plug the device into my laptop which will do a mid-discharge charge.

    Glad the devs are so involved, but hey it's a nexus so this should be expected, right? :D
  3. Jersey Tom

    Jersey Tom Android Enthusiast

    Will do this tonight.
  4. yawdapaah

    yawdapaah Android Expert

    Does the initial charge value matter? You said charge to a "set amount".
  5. Stigy

    Stigy Some say...
    Thread Starter

    Nope -- just so you know how much battery you lose after the test is over.
  6. yawdapaah

    yawdapaah Android Expert

    OK. I'm trying it out. I guess he's trying to test the wifi suspend wakelock issue?
  7. Stigy

    Stigy Some say...
    Thread Starter

    Trying to pinpoint if the issue is related to Wifi or cell signal I believe.

    When on WiFi testing this morning, this was my numbers.

  8. yawdapaah

    yawdapaah Android Expert

  9. keatre

    keatre Well-Known Member

  10. PhilosoRaptor

    PhilosoRaptor Android Enthusiast

    I left mine off the charger the first night I owned it to see if I would have some of the same issues I saw some users reporting (high battery drain/awake times while screen was off).

    Here's what I got:


    Almost 10 hours and dropped 10% steadily across the time. All while WiFi was on and I have a couple services that poll mail and weather every hour or so.

    The phone seems to do great while idle. But when I'm using it, it tanks the battery fast from what I've seen. I keep brightness at auto and disable WiFi/BT/GPS when I'm not using them.
  11. keatre

    keatre Well-Known Member

    Do you happen to know what your AndroidOS awaketime is? The battery tanking may be to other factors, but I dont think its the AndroidOS (as long as you're on WiFi).

    If you need other help, please post and let us know.
  12. PhilosoRaptor

    PhilosoRaptor Android Enthusiast

    No, never thought to check the OS Awake time. I'll check it after work tomorrow and post back. It actually seems to have decent battery life while at home on WiFi. It's when I'm using it at work that the battery seems to dive a lot harder. I work in the center of a big building where there's low signal too though, so I'm wondering if that's what's eating it the most (holding onto a weak signal/constantly polling for data when it can't reach out to update something).
  13. keatre

    keatre Well-Known Member

    You can discuss with Stigy, but its not actually a 'signal strength' thing per-se. WiFi is suspending the mobile data 'driver' that is going rouge.

    Basically, from a high overview, even with ZERO data being sent, while connected to EVDO/LTE, the waketime will still be quite high.

    If other lurkers wouldn't mind posting results from Stigy's first post, that would be greatly helpful. Any questions, please PM Stigy.
  14. yawdapaah

    yawdapaah Android Expert

    Yeah it's a lot better. In previous android versions the suspend wake lock caused massive drain but it looks like that's been fixed this time around. Keeping wifi on seems like a decent stopgap for now.
  15. APKhaos

    APKhaos Well-Known Member

    Just set it up to run overnight, which should be good for uninterrupted cpu sleep. LightFlow is running, as is GMail. Might run again tomorrow night with either or both of these force closed. Not rooted, unfortunately.

    FWIW, I'm consistently seeing relatively high KeepAwake numbers.
  16. Stigy

    Stigy Some say...
    Thread Starter

    Awesome - thanks. Would love to see your numbers and graphs in the morning.

    Thanks to all participating in this test!
  17. APKhaos

    APKhaos Well-Known Member


    [cross posted here to keep the results in one thread]

    Here are the results from last night's run:
    - Setup as specified by Stigy
    - GMail and LightFlow were running
    - Test run 8:15:00 of basically nothing but what should have been sleep time
    - Battery state: At at start of test 71%, at end of test 48%


    It seems clear that something is causing Keep Awake, but its not clear what that something is. Hopefully Stigy's crew will nail it.

    I can run this again with selected apps closed if that helps.
  18. Romparoo

    Romparoo Android Enthusiast

    So it looks like something, which we don't know what, is keeping the Android OS awake.

    How does this test determine what it is?
  19. Stigy

    Stigy Some say...
    Thread Starter

    Just got a PM from keatre over at XDA -- quoting below.


    The people without root are just confirming Android OS doesn't stay awake with WiFi on. The people with root who can send in logs will show him what is actually keeping Android OS awake.
  20. Stigy

    Stigy Some say...
    Thread Starter

    Quoting because I was incorrect.

    The user needs to clear their battery stats before they start the test. Either clear it in bootloader or charge to full, then unplug.

    People are starting at 78%, and AndroidOS is factoring in their other runtimes.
  21. ska.t73

    ska.t73 Android Expert

    So Stigy, does this mean we should keep WiFi on at all times, even when it isn't connected? I have been so used to keeping it off when not in use that it has just become second nature. What I'm asking is, will the WiFi stopgap work if WiFi isn't connected and simply on?
    jkc120 likes this.
  22. jkc120

    jkc120 Android Expert

    I don't have detailed analysis to back this up, just my anecdotal observation from last night. I had wifi enabled but was well out of range of the WAP in my folks' house, and my battery dropped about 7% over night. I'm curious if keeping wifi on avoids this, too, though. Great question.
    ska.t73 likes this.
  23. Romparoo

    Romparoo Android Enthusiast

    Thanks. I have not yet rooted. I reported my 29% drainage last night in the other thread, I don't think I mentioned that WiFi was on the entire time.

    So, it wifi is suppose to help with the OS drainage, then I would think I would not have loss so much last night while I slept.

    Thanks for posting here. I usually always check both forums but am sticking here for the time being.
  24. Jersey Tom

    Jersey Tom Android Enthusiast

    I don't think Wifi On is a solution. Wifi was on the other morning when I had my most significant drain of 30% in less than 2 hours with the phone idle almost the whole time.
  25. Dubbin1

    Dubbin1 Android Expert

    Just thinking out loud here but wouldn't it wake up every time the phone syncs? Maybe someone having high usage should shut off syncing and see what happens. Even things like the weather apps almost all of us use constantly sync to keep the weather up to date.

    What we really need to see is the usage from a GN with no apps, email or anything that will sync.

Galaxy Nexus Forum

The Galaxy Nexus release date was November 2011. Features and Specs include a 4.65" inch screen, 5MP camera, 1GB RAM, TI OMAP 4460 processor, and 1750mAh battery.

November 2011
Release Date

Share This Page