summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAravind Akella <aakella@google.com>2015-10-16 14:18:40 -0700
committerAravind Akella <aakella@google.com>2015-10-19 12:18:37 -0700
commita05df455e81909e97c8ab869f5528c32e17ae59e (patch)
treeae396713df947dda7ce5f53476c322c31ebc1f29 /core
parentbdf952aab732ebcaab0d785cd02ffb83e3738e21 (diff)
downloadframeworks_base-a05df455e81909e97c8ab869f5528c32e17ae59e.zip
frameworks_base-a05df455e81909e97c8ab869f5528c32e17ae59e.tar.gz
frameworks_base-a05df455e81909e97c8ab869f5528c32e17ae59e.tar.bz2
Fix a possible race condition in SensorManager initialization.
Bug: 24526176 Change-Id: Ib8bae6eee16a5b787d3c2da6ef03af311cfdfadc
Diffstat (limited to 'core')
-rw-r--r--core/java/android/hardware/SystemSensorManager.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index 30cdfd3..2fe8fb6 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -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);
+ }
}
}