Merge "DO NOT MERGE Set the sensor threshold only if sensor exists" into qt-qpr1-dev

This commit is contained in:
Heemin Seog
2020-03-06 22:15:42 +00:00
committed by Android (Google) Code Review

View File

@@ -305,7 +305,7 @@ public class DozeSensors {
mContext.getResources());
} else {
sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
mSensorThreshold = sensor.getMaximumRange();
mSensorThreshold = sensor == null ? 0 : sensor.getMaximumRange();
}
mSensor = sensor;
}