Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6306169f authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Add fallback for sensor identification in ddc

If a display device config was specified but without a valid ambient light sensor, it would fall back to Sensor.TYPE_LIGHT rather than the specified one in config.xml. This change fixes that.

Bug: 187130675
Test: adb shell dumpsys display | grep DisplayDeviceConfig
Test: com.android.server.display
Change-Id: I5b3f71a7c32055dbbd43d8fd139cfa7d09b9b3c4
parent d2ca79d4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -689,6 +689,8 @@ public class DisplayDeviceConfig {
        if (sensorDetails != null) {
            mAmbientLightSensor.type = sensorDetails.getType();
            mAmbientLightSensor.name = sensorDetails.getName();
        } else {
            loadAmbientLightSensorFromConfigXml();
        }
    }