Merge "Send display-OFF event if that is initial state." into sc-dev

This commit is contained in:
Santos Cordon
2021-02-24 15:05:38 +00:00
committed by Android (Google) Code Review

View File

@@ -718,7 +718,12 @@ final class LocalDisplayAdapter extends DisplayAdapter {
setDisplayState(Display.STATE_ON);
currentState = Display.STATE_ON;
} else {
return; // old state and new state is off
if (oldState == Display.STATE_UNKNOWN) {
// There's no guarantee about what the initial state is
// at startup, so we have to set it if previous was UNKNOWN.
setDisplayState(state);
}
return;
}
}