Preference to disable device sensors

RESOLVED FIXED in mozilla15

Status

()

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dougt, Assigned: dougt)

Tracking

unspecified
mozilla15
x86
macOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
we had a preference named device.motion.enabled.  This disabled device motion.  Lets change this to be device.sensors.enabled and have it govern all device sensors.  Also, lets never startup sensors (call through to hal) if the preference is false.
(Assignee)

Comment 1

7 years ago
Posted patch patch v.1Splinter Review
Assignee: nobody → doug.turner
Attachment #610592 - Flags: review?(bugs)
Comment on attachment 610592 [details] [diff] [review]
patch v.1


> NS_IMETHODIMP nsDeviceSensors::AddWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
> {
>+  if (!mEnabled)
>+    return NS_OK;
You know very well that I would prefer {} ;) ,
but since this code seems to use some
strange coding style anyway, I don't care.



>+
>   if (mWindowListeners[aType]->IndexOf(aWindow) != NoIndex)
>     return NS_OK;
> 
>   if (!IsSensorEnabled(aType)) {
>     RegisterSensorObserver((SensorType)aType, this);
>   }
> 
>   mWindowListeners[aType]->AppendElement(aWindow);
>   return NS_OK;
> }
> 
> NS_IMETHODIMP nsDeviceSensors::RemoveWindowListener(PRUint32 aType, nsIDOMWindow *aWindow)
> {
>+  if (!mEnabled)
>+    return NS_OK;
Why do we need this?
Attachment #610592 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/270db83fa61c
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.