Last Comment Bug 702511 - Battery API: Please clarify what values are actually being returned from .chargingTime and .dischargingTime
: Battery API: Please clarify what values are actually being returned from .ch...
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on: 699743
  Show dependency treegraph
Reported: 2011-11-14 19:48 PST by John Hammink
Modified: 2011-11-15 14:45 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image John Hammink 2011-11-14 19:48:38 PST
If I leave my devices plugged in long enough to get .chargingTime  or leave them unplugged long enough to get .dischargingTime (other than Infinity)  I am not sure what values I am seeing.

1.  Does it return seconds, or ms?
2.  Are the values cumulative? for the life of the battery?  
3. If so, what are the start and stop conditions for accumulating these times?  4.  Is there a way to "reset" these values, so I can start from zero?
5.  Where are these values coming from?   For example, in android.os.battery I see no api for getting total charge and discharge times...

For example:
I have been discharging my devices for approximately 5 minutes, long enough for the batteries to drain approx the 2% to generate a dischargingTime value.   

One of my devices returns "240", the other, older device returns 3480.  What do these values mean?

Thanks for your clarification?
Comment 1 User image John Hammink 2011-11-14 20:02:16 PST
What's more, I've noticed that once my charging level goes to 100% (battery fully charged), .chargingTime returns 0.   Is that correct?

And on my older device, charging time returns 336, but I know the device has been charging for longer than that for its lifetime (if the value is, in fact, cumulative).
Comment 2 User image John Hammink 2011-11-15 14:45:27 PST
It took a bit of digging around but I found this:
of type double, readonly
> Represents the time remaining in seconds until the system's battery is fully charged. The

seems to be based on remainingTime where it is the time remaining in seconds until the battery is fully discharged.

I'll update my testpages/testcases accordingly.

Note You need to log in before you can comment on or make changes to this bug.