Closed Bug 740473 Opened 12 years ago Closed 12 years ago

Preference to disable device sensors

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

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.
Attached 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
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.