VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1124127

⇱ 1124127 - Round Off Navigator Battery Level on Linux


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
Core
Hardware Abstraction Layer (HAL)
35 Branch
x86
Linux
defect
Not set
normal
Points:
---
RESOLVED FIXED
RESOLVED
FIXED
mozilla38
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
firefox-esr115
firefox-esr140
firefox-esr153
firefox152
firefox153
firefox154
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
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.
Reporter

Updated

β€’
11 years ago
Keywords: privacy
Priority: -- β†’ P1
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)
(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 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+
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.