The default bug view has changed. See this FAQ.

Add remainingTime support to upower backend

RESOLVED FIXED in mozilla11

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla11
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 572429 [details] [diff] [review]
Patch v1
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)
(Assignee)

Comment 2

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

Comment 3

5 years ago
Created attachment 572753 [details] [diff] [review]
Patch v1.1
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)
(Assignee)

Comment 5

5 years ago
Created attachment 572965 [details] [diff] [review]
Patch v1.1 with a comment
Attachment #572753 - Attachment is obsolete: true
Attachment #572965 - Flags: review?(jones.chris.g)
Attachment #572965 - Flags: review?(jones.chris.g) → review+
(Assignee)

Updated

5 years ago
Flags: in-testsuite?
Whiteboard: [needs review]
(Assignee)

Comment 6

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11

Comment 8

5 years ago
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-
You need to log in before you can comment on or make changes to this bug.