author | Doug Turner <dougt@dougt.org> |
Wed, 21 Mar 2012 22:27:51 -0700 | |
changeset 90025 | 41f85ded0197c8cf5af119fe31edc7dbec336cb4 |
parent 90024 | 46baca135a4c2c9530500880d03d19fc28e7cc05 |
child 90026 | 1a0a9c190dd928449f191ebb81346f2c941dae78 |
push id | 22308 |
push user | mak77@bonardo.net |
push date | Fri, 23 Mar 2012 01:00:29 +0000 |
treeherder | mozilla-central@70ac5065caee [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jdm |
bugs | 738102 |
milestone | 14.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/hal/cocoa/CocoaSensor.mm +++ b/hal/cocoa/CocoaSensor.mm @@ -28,33 +28,41 @@ void UpdateHandler(nsITimer *aTimer, voi hal::SensorData sdata(hal::SENSOR_ACCELERATION, PR_Now(), values, hal::SENSOR_ACCURACY_UNKNOWN); hal::NotifySensorChange(sdata); } void -EnableSensorNotifications(SensorType aSensor) { +EnableSensorNotifications(SensorType aSensor) +{ + if (aSensor != SENSOR_ACCELERATION) + return; + if (sUpdateTimer) return; smsStartup(nil, nil); smsLoadCalibration(); CallCreateInstance("@mozilla.org/timer;1", &sUpdateTimer); if (sUpdateTimer) sUpdateTimer->InitWithFuncCallback(UpdateHandler, NULL, DEFAULT_SENSOR_POLL, nsITimer::TYPE_REPEATING_SLACK); } void -DisableSensorNotifications(SensorType aSensor) { +DisableSensorNotifications(SensorType aSensor) +{ + if (aSensor != SENSOR_ACCELERATION) + return; + if (sUpdateTimer) { sUpdateTimer->Cancel(); NS_RELEASE(sUpdateTimer); } smsShutdown(); } } // hal_impl