summaryrefslogtreecommitdiffstats
path: root/services/sensorservice
diff options
context:
space:
mode:
authorAravind Akella <aakella@google.com>2014-10-07 14:13:12 -0700
committerAravind Akella <aakella@google.com>2014-10-07 21:20:12 +0000
commit7830ef3dd0ff3749d974c2dd85a8fa59dc47aeca (patch)
treee6ad68ea20f80b48138a310b50b9cea44dce3afa /services/sensorservice
parent78639c22acfa5e56d87fd6fe8340d083536b29fc (diff)
downloadframeworks_native-7830ef3dd0ff3749d974c2dd85a8fa59dc47aeca.zip
frameworks_native-7830ef3dd0ff3749d974c2dd85a8fa59dc47aeca.tar.gz
frameworks_native-7830ef3dd0ff3749d974c2dd85a8fa59dc47aeca.tar.bz2
Change ordering of memory allocation and calling Thread::run().
In some cases this is causing a crash as device.poll is called with NULL. Bug: 17896339 Change-Id: Id431599f2c661338c355c7081b6602f8449a9198
Diffstat (limited to 'services/sensorservice')
-rw-r--r--services/sensorservice/SensorService.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 8831893..0f945f7 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -185,14 +185,14 @@ void SensorService::onFirstRef()
}
mWakeLockAcquired = false;
- run("SensorService", PRIORITY_URGENT_DISPLAY);
mLooper = new Looper(false);
-
const size_t minBufferSize = SensorEventQueue::MAX_RECEIVE_BUFFER_EVENT_COUNT;
mSensorEventBuffer = new sensors_event_t[minBufferSize];
mSensorEventScratch = new sensors_event_t[minBufferSize];
mMapFlushEventsToConnections = new SensorEventConnection const * [minBufferSize];
+
mInitCheck = NO_ERROR;
+ run("SensorService", PRIORITY_URGENT_DISPLAY);
}
}
}