Round Off Ambient Light Sensor event.value

RESOLVED FIXED in Firefox 51

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: lukasz.w3c, Assigned: droeh)

Tracking

({mobile, privacy})

49 Branch
Firefox 51
Unspecified
Android
Points:
---

Firefox Tracking Flags

(fennec51+, firefox51 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Steps to reproduce:

User-Agent: Mozilla/5.0 (Android 6.0.1; Mobile; rv:49.0) Gecko/49.0 Firefox/49.0

I entered a web site registering devicelight events.



Actual results:

The event.value readout is too verbose:

75.2131500244140625 lx  
435.8228149414062500 lx  
548.1655883789062500 lx  
13 lx 



Expected results:

The event.value readout should be rounded:

75 lx  
435 lx  
548 lx  
13 lx 

Providing too verbose, non-rounded illuminance values can potentially open unexpected issues related to fingerprinting, tracking and data leaks (possibly similarly to http://lukaszolejnik.com/battery.pdf, but potentially more directly). It is also not necessary from a physical point of view. Please also see https://bugzilla.mozilla.org/show_bug.cgi?id=1124127
(Reporter)

Updated

3 years ago
Component: General → Data Providers
Keywords: mobile, privacy
OS: Unspecified → Android
tracking-fennec: --- → ?
This comes after the over-precision of the BatteryStatus API returns in Mobile Firefox. (Bug: 1124127)

It would be great if FF mobile had a systematic way of assessing whether sensor API returns are overly-precise.
Assignee: nobody → droeh
(Assignee)

Comment 2

3 years ago
I can't actually reproduce this on a Nexus 6 running Android N (the values are already rounded to integers for me), but it's an easy enough fix regardless. This patch just rounds the event value before creating the DeviceLightEvent.
Attachment #8789500 - Flags: review?(snorp)
Attachment #8789500 - Flags: review?(snorp) → review+
I don't know if integer precision is still too much or not. Seems like it probably is, but this is a start.

Comment 4

3 years ago
Pushed by droeh@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f41a22a14e0d
Round event value before creating a DeviceLightEvent. r=snorp

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f41a22a14e0d
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
tracking-fennec: ? → 51+
You need to log in before you can comment on or make changes to this bug.