Closed Bug 1299454 Opened 9 years ago Closed 9 years ago

Round Off Ambient Light Sensor event.value

Categories

(Firefox for Android Graveyard :: Data Providers, defect)

49 Branch
Unspecified
Android
defect
Not set
normal

Tracking

(fennec51+, firefox51 fixed)

RESOLVED FIXED
Firefox 51
Tracking Status
fennec 51+ ---
firefox51 --- fixed

People

(Reporter: lukasz.w3c, Assigned: droeh)

References

Details

(Keywords: mobile, privacy)

Attachments

(1 file)

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
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
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.
Pushed by droeh@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f41a22a14e0d Round event value before creating a DeviceLightEvent. r=snorp
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
tracking-fennec: ? → 51+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: