Last Comment Bug 705084 - Battery API: chargingTime should return 0 if there is no battery plugged in
: Battery API: chargingTime should return 0 if there is no battery plugged in
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Mounir Lamouri (:mounir)
:
Mentors:
Depends on: 707085 823286
Blocks: 678694
  Show dependency treegraph
 
Reported: 2011-11-24 03:25 PST by Mounir Lamouri (:mounir)
Modified: 2012-12-19 15:29 PST (History)
2 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Part A - Add kDefaultRemainingTime and add guards to make sure backends are correct (2.25 KB, patch)
2011-11-29 15:24 PST, Mounir Lamouri (:mounir)
jonas: review+
mounir: checkin+
Details | Diff | Splinter Review
Part B - Fix in UPower backend (1.39 KB, patch)
2011-11-29 15:25 PST, Mounir Lamouri (:mounir)
cjones.bugs: review+
mounir: checkin+
Details | Diff | Splinter Review
Part C - Fix in Android backend (2.10 KB, patch)
2011-11-29 15:25 PST, Mounir Lamouri (:mounir)
cjones.bugs: review+
mounir: checkin+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-11-24 03:25:12 PST
With that changes, it will not be possible for the websites to know if the users has a fully charged battery or no battery at all [1].

We will have to add a way to know if the user has a battery but that might be trough another specification or trough an explicit attribute.

[1] Before, the difference with a fully charged battery and no battery was chargingTime being 0 or Infinity.
Comment 1 Mounir Lamouri (:mounir) 2011-11-29 15:24:38 PST
Created attachment 577771 [details] [diff] [review]
Part A - Add kDefaultRemainingTime and add guards to make sure backends are correct
Comment 2 Mounir Lamouri (:mounir) 2011-11-29 15:25:19 PST
Created attachment 577772 [details] [diff] [review]
Part B - Fix in UPower backend
Comment 3 Mounir Lamouri (:mounir) 2011-11-29 15:25:54 PST
Created attachment 577774 [details] [diff] [review]
Part C - Fix in Android backend
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-11-30 09:26:41 PST
Comment on attachment 577774 [details] [diff] [review]
Part C - Fix in Android backend

>-  private static double  sRemainingTime              = kUnknownRemainingTime;;
>+  private static double  sRemainingTime              = kDefaultRemainingTime;;
> 

Kill the double semicolon while you're editing this file.

r=me with that.
Comment 5 Jonas Sicking (:sicking) No longer reading bugmail consistently 2011-11-30 16:22:57 PST
Comment on attachment 577771 [details] [diff] [review]
Part A - Add kDefaultRemainingTime and add guards to make sure backends are correct

Review of attachment 577771 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

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