Preference to disable device sensors

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: dougt, Assigned: dougt)

Tracking

unspecified
mozilla15
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 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

6 years ago
Created attachment 610592 [details] [diff] [review]
patch v.1
Assignee: nobody → doug.turner
Attachment #610592 - Flags: review?(bugs)

Comment 2

6 years ago
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+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/270db83fa61c

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/270db83fa61c
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.