Closed
Bug 1124127
Opened 11 years ago
Closed 11 years ago
Round Off Navigator Battery Level on Linux
Round Off Navigator Battery Level on Linux
---
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
0
Bug Flags:
|
1.74 KB,
patch
|
gsvelto
:
review+
|
Details | Diff | Splinter Review |
| Reporter | |
Descriptionβ’11 years ago
|
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150112203157
Steps to reproduce:
On Linux, open the developer console and check navigator.battery.level
Actual results:
The battery level is reported with 16 decimal places (e.g. 0.1600730371272063)
Expected results:
The battery level should be rounded to two decimal places (e.g. 0.16) as itβs on Windows and Mac.
On Mac and Windows, Firefox reports the battery level with 2 decimal places (e.g. 0.16). On Linux, Firefox reads the battery level from D-Bus, and make it available to Web platform without rounding it off (e.g. 0.1600730371272063).
By using the high-precision battery level readouts from the Battery API (navigator.battery.level), one can detect the battery capacity and use it as a short-term tracking identifier. This is done by solving a linear system of equations and exploiting floating point quirks, thanks to the double precision reading exposed to the Web platform.
The battery capacity may not be a fingerprinting method with severe consequences, since itβs very short-lived -- the battery capacity may be updated when the battery is fully charged. But itβs rather unexpected, the extra precision serves no purpose, and there is a mismatch between Firefoxβs behavior on Linux vs. Mac & Win.
| Assignee | |
Updatedβ’11 years ago
|
Component: Untriaged β DOM
Product: Firefox β Core
| Assignee | |
Comment 1β’11 years ago
|
FWIW, I can't reproduce this; I guess the number reported by dbus is hardware/kernel/whatever-dependent (I'm testing in a vmware fusion vm on a mac).
Component: DOM β Hardware Abstraction Layer (HAL)
Priority: P1 β --
| Assignee | |
Comment 2β’11 years ago
|
Mounir, does this make sense? You seem to have written most of this.
Attachment #8552454 -
Flags: review?(mounir)
| Assignee | |
Updatedβ’11 years ago
|
Assignee: nobody β gijskruitbosch+bugs
Status: UNCONFIRMED β ASSIGNED
Ever confirmed: true
| Assignee | |
Comment 3β’11 years ago
|
Comment on attachment 8552454 [details] [diff] [review]
round power percentage to whole number before passing on,
I hear Mounir left. Gabriele, can you review this or find someone who can?
Attachment #8552454 -
Flags: review?(mounir) β review?(gsvelto)
Comment 4β’11 years ago
|
(In reply to :Gijs Kruitbosch from comment #3)
> I hear Mounir left. Gabriele, can you review this or find someone who can?
Sure, for reviews of HAL patches it's either :dhylands who is the component owner or me, the sole peer ATM.
Comment 5β’11 years ago
|
Comment on attachment 8552454 [details] [diff] [review]
round power percentage to whole number before passing on,
Review of attachment 8552454 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM with a minuscule nit.
::: hal/linux/UPowerClient.cpp
@@ +431,2 @@
> /*
> * The battery level might be very close to 100% (like 99.xxxx%) without
nit: This comment suggests that a reading might have four decimal places, better to update it too to avoid confusion.
Attachment #8552454 -
Flags: review?(gsvelto) β review+
| Assignee | |
Comment 6β’11 years ago
|
Comment 7β’11 years ago
|
Status: ASSIGNED β RESOLVED
Closed: 11 years ago
Resolution: --- β FIXED
Target Milestone: --- β mozilla38
You need to log in
before you can comment on or make changes to this bug.
