Battery API: chargingTime should return 0 if there is no battery plugged in

RESOLVED FIXED in mozilla11

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla11
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 577771 [details] [diff] [review]
Part A - Add kDefaultRemainingTime and add guards to make sure backends are correct
Attachment #577771 - Flags: review?(jonas)
(Assignee)

Comment 2

6 years ago
Created attachment 577772 [details] [diff] [review]
Part B - Fix in UPower backend
Attachment #577772 - Flags: review?(jones.chris.g)
(Assignee)

Comment 3

6 years ago
Created attachment 577774 [details] [diff] [review]
Part C - Fix in Android backend
Attachment #577774 - Flags: review?(jones.chris.g)
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
Whiteboard: [needs review]
Attachment #577772 - Flags: review?(jones.chris.g) → review+
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.
Attachment #577774 - Flags: review?(jones.chris.g) → review+
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
Attachment #577771 - Flags: review?(jonas) → review+
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
Whiteboard: [needs review]
Target Milestone: --- → mozilla11
(Assignee)

Updated

6 years ago
Attachment #577771 - Flags: checkin+
(Assignee)

Updated

6 years ago
Attachment #577772 - Flags: checkin+
(Assignee)

Updated

6 years ago
Attachment #577774 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/fc7d25349c10
https://hg.mozilla.org/mozilla-central/rev/197c9ea3fb2a
https://hg.mozilla.org/mozilla-central/rev/aca0075d85cf
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Depends on: 707085
Depends on: 823286
You need to log in before you can comment on or make changes to this bug.