Add null check for default proximity sensor.
Without this we fail to boot on devices without a proximity sensor, such as FVP. Bug: 142352330 Change-Id: I474628d7ba32a9178fd720563fe2eca177920203 Merged-In: I474628d7ba32a9178fd720563fe2eca177920203
This commit is contained in:
committed by
Dave Mankoff
parent
dae7609a1a
commit
67a07c2223
@@ -44,7 +44,7 @@ public class SensorModule {
|
||||
Sensor defaultSensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
||||
return thresholdSensorBuilder
|
||||
.setSensor(defaultSensor)
|
||||
.setThresholdValue(defaultSensor.getMaximumRange())
|
||||
.setThresholdValue(defaultSensor != null ? defaultSensor.getMaximumRange() : 0)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user