Closed Bug 1191918 Opened 4 years ago Closed 4 years ago

Round battery level to integers (or tens?) to mitigate finger printing

Categories

(Firefox for Android :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 44
Tracking Status
firefox42 --- affected
firefox43 --- fixed
firefox44 --- fixed
fennec 42+ ---

People

(Reporter: blassey, Assigned: snorp)

References

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

we could round to integers for EV certs and to 10% increments for everything else.
This rounds the battery level to the nearest 10% except for certified apps and chrome. I am not sure if we have precedent for doing stuff like this based on the cert.
Comment on attachment 8666908 [details] [diff] [review]
Round battery level to nearest 10%

>+    if (remainder >= 5) {

Why not:

  mLevel = round(mLevel * 10) / 10;

instead of doing rounding-to-nearest yourself?  If there's a reason to implement your own rounding as you do here, please at least document it.  

And if the manual rounding _is_ needed, do we actually want it to be rounding .846 to .9, say?

Please document the mLevel member with some indication of the range of values it can take on.

r=me with those fixed.
Attachment #8666908 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/71cca20b59db
https://hg.mozilla.org/mozilla-central/rev/d51440cc7a2f
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Comment on attachment 8666908 [details] [diff] [review]
Round battery level to nearest 10%

Approval Request Comment
[Feature/regressing bug #]: None
[User impact if declined]: Increased exposure to tracking
[Describe test coverage new/current, TreeHerder]: m-c
[Risks and why]: Low
[String/UUID change made/needed]: None

Sheriffs, please be sure to uplift the embarrassing follow-up patch[0], otherwise this will break everything.

[0] https://hg.mozilla.org/mozilla-central/rev/d51440cc7a2f
Attachment #8666908 - Flags: approval-mozilla-beta?
Attachment #8666908 - Flags: approval-mozilla-aurora?
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #7)

I should add, the patch that was committed is not the same as the one attached here, so please take the one that landed on m-c.
Comment on attachment 8666908 [details] [diff] [review]
Round battery level to nearest 10%

I would prefer to see this change ride the train from 43 and not 42.
Attachment #8666908 - Flags: approval-mozilla-beta?
Attachment #8666908 - Flags: approval-mozilla-beta-
Attachment #8666908 - Flags: approval-mozilla-aurora?
Attachment #8666908 - Flags: approval-mozilla-aurora+
Do I understand correctly that this just outruled any Firefox OS app that can show reasonable system information including battery level? There were a lot of discussions about the Battery API where it was deemed not to be a fingerprinting issue at all because it changes all the time and only things that stay constant for a device are interesting for fingerprinting. Where is the analysis that suddenly says something else? (As the tone can't be determined from writing, I'm not angry, merely very surprised about this as it seems like a 180° turn from what we said before about this API.)
Depends on: 1250106
Depends on: 1250109
You need to log in before you can comment on or make changes to this bug.