Ensure valid brightness is sent to surface control
Since brightnessState(valid range, off, invalid) is being passed in rather than brightness value(0-1 range), check that it is a valid value. Bug: 178088604 Test: manual Change-Id: Ic0a8c04d160ef318fe7a450c8c363ae5d907cbc7
This commit is contained in:
@@ -767,6 +767,12 @@ final class LocalDisplayAdapter extends DisplayAdapter {
|
||||
}
|
||||
|
||||
private void setDisplayBrightness(float brightness) {
|
||||
// Ensure brightnessState is valid, before processing and sending to
|
||||
// surface control
|
||||
if (Float.isNaN(brightness)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Slog.d(TAG, "setDisplayBrightness("
|
||||
+ "id=" + physicalDisplayId
|
||||
|
||||
Reference in New Issue
Block a user