Closed Bug 700262 Opened 8 years ago Closed 8 years ago

Add remainingTime support to upower backend

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: mounir, Assigned: mounir)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Patch v1 (obsolete) — Splinter Review
No description provided.
Attachment #572429 - Flags: review?(jones.chris.g)
Comment on attachment 572429 [details] [diff] [review]
Patch v1

>+  aBatteryInfo->remainingTime() = upowerClient->GetRemainingTime();;

Empty statement here (double semicolon).  Some compilers are picky
about that.

>+  if (isFull) {
>+    mRemainingTime = 0;

This seems strange to me.  Shouldn't we use TimeToEmpty in this case?
Does the spec say something about it?
Attachment #572429 - Flags: review?(jones.chris.g)
(In reply to Chris Jones [:cjones] [:warhammer] from comment #1)
> >+  if (isFull) {
> >+    mRemainingTime = 0;
> 
> This seems strange to me.  Shouldn't we use TimeToEmpty in this case?
> Does the spec say something about it?

Basically, when .charging is true, we have to use .chargingTime and .charging is false, we use .dischargingTime so if we are full (and charging), the chargingTime should be 0. Which is the case here. We could be using TimeToFull here but I'm not sure what the value would be given that 0 is for unknown values is upower...
Attached patch Patch v1.1 (obsolete) — Splinter Review
Attachment #572429 - Attachment is obsolete: true
Attachment #572753 - Flags: review?(jones.chris.g)
Comment on attachment 572753 [details] [diff] [review]
Patch v1.1

Waiting to hear back if FullyCharged => Charging.
Attachment #572753 - Flags: review?(jones.chris.g)
Attachment #572753 - Attachment is obsolete: true
Attachment #572965 - Flags: review?(jones.chris.g)
Attachment #572965 - Flags: review?(jones.chris.g) → review+
Flags: in-testsuite?
Whiteboard: [needs review]
Comment on attachment 572965 [details] [diff] [review]
Patch v1.1 with a comment

This has just landed in mozilla-inbound. Requesting aurora approval for API completeness in Firefox 10. It would be better to ship Firefox 10 with the entire API if we say it is present. The risk is very low given that there is no use of the API for the moment.
Attachment #572965 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/09eb49521f13
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Comment on attachment 572965 [details] [diff] [review]
Patch v1.1 with a comment

It looks like this feature wasn't ready for 10. Please re-nominate if you have a good justification for trying to get this into 10 rather than just waiting for 11.
Attachment #572965 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.