Merge "DO NOT MERGE Set the sensor threshold only if sensor exists" into qt-qpr1-dev
This commit is contained in:
@@ -305,7 +305,7 @@ public class DozeSensors {
|
|||||||
mContext.getResources());
|
mContext.getResources());
|
||||||
} else {
|
} else {
|
||||||
sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
||||||
mSensorThreshold = sensor.getMaximumRange();
|
mSensorThreshold = sensor == null ? 0 : sensor.getMaximumRange();
|
||||||
}
|
}
|
||||||
mSensor = sensor;
|
mSensor = sensor;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user