Merge "Allow No Sensor to be Specified in DDC"
This commit is contained in:
committed by
Android (Google) Code Review
commit
fa648d660a
@@ -1941,8 +1941,8 @@ public class DisplayDeviceConfig {
|
||||
}
|
||||
|
||||
private void setProxSensorUnspecified() {
|
||||
mProximitySensor.name = "";
|
||||
mProximitySensor.type = "";
|
||||
mProximitySensor.name = null;
|
||||
mProximitySensor.type = null;
|
||||
}
|
||||
|
||||
private void loadProxSensorFromDdc(DisplayConfiguration config) {
|
||||
|
||||
@@ -33,6 +33,9 @@ public class SensorUtils {
|
||||
*/
|
||||
public static Sensor findSensor(SensorManager sensorManager, String sensorType,
|
||||
String sensorName, int fallbackType) {
|
||||
if ("".equals(sensorName) && "".equals(sensorType)) {
|
||||
return null;
|
||||
}
|
||||
final boolean isNameSpecified = !TextUtils.isEmpty(sensorName);
|
||||
final boolean isTypeSpecified = !TextUtils.isEmpty(sensorType);
|
||||
if (isNameSpecified || isTypeSpecified) {
|
||||
|
||||
Reference in New Issue
Block a user