Merge "Fix a possible race condition in SensorManager initialization." into mnc-dr-dev

am: a817c90a7a

* commit 'a817c90a7ab296473345b0e106acc9be4e5b678c':
  Fix a possible race condition in SensorManager initialization.
This commit is contained in:
Aravind Akella
2015-10-19 21:32:25 +00:00
committed by android-build-merger

View File

@@ -78,14 +78,14 @@ public class SystemSensorManager extends SensorManager {
sSensorModuleInitialized = true;
nativeClassInit();
}
}
// initialize the sensor list
for (int index = 0;;++index) {
Sensor sensor = new Sensor();
if (!nativeGetSensorAtIndex(mNativeInstance, sensor, index)) break;
mFullSensorsList.add(sensor);
mHandleToSensor.append(sensor.getHandle(), sensor);
// initialize the sensor list
for (int index = 0;;++index) {
Sensor sensor = new Sensor();
if (!nativeGetSensorAtIndex(mNativeInstance, sensor, index)) break;
mFullSensorsList.add(sensor);
mHandleToSensor.append(sensor.getHandle(), sensor);
}
}
}