Closed
Bug 740473
Opened 13 years ago
Closed 13 years ago
Preference to disable device sensors
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: dougt, Assigned: dougt)
Details
Attachments
(1 file)
2.38 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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•13 years ago
|
||
Assignee: nobody → doug.turner
Attachment #610592 -
Flags: review?(bugs)
Comment 2•13 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•13 years ago
|
||
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in
before you can comment on or make changes to this bug.
Description
•