Allow No Sensor to be Specified in DDC
Adding the following: <proxSensor> <type></type> <name></name> </proxSensor> to the DDC, will stop any fallback from being used, and allow the usage of no sensor to be used for that display. This is useful for when a display has no sensor and the fallback should not be used. If this is not added to the ddc, the fallback will still only occur if the display is the default display. Bug: 202604469 Test: dumpsys display | grep mProximitySensor Test: com.android.server.display Change-Id: I8508a191b7c7c5990929e4d020ffd144c7faeef7
This commit is contained in:
@@ -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