Closed Bug 1191918 Opened 7 years ago Closed 7 years ago

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


(Firefox for Android Graveyard :: General, defect)

Not set


(firefox42 affected, firefox43 fixed, firefox44 fixed, fennec42+)

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


(Reporter: blassey, Assigned: snorp)



(Keywords: dev-doc-needed)


(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+
Closed: 7 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.

Attachment #8666908 - Flags: approval-mozilla-beta?
Attachment #8666908 - Flags: approval-mozilla-aurora?
(In reply to James Willcox (:snorp) ( 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
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.