Turn OFF any changing displays during device-state transitions

When transitioning from one device state to another,
turn off any displays that are going to change. This avoids
some jank and allows for devices that don't want more than
one display on at once.

1) Changes the isEnabled variable of LogicalDisplay to
a concept of display phases which can go between DISABLED,
ON, and TRANSITION. DISABLED meants the display is not visible to the
rest of the system. TRANSITION meants the display should remain off.
ON means that the display is running normally and its power should be
calculated by DisplayPowerController.

2) Displays will now remain off until WindowManager is finished
rendering the windows, which removes the device-state-transition
window jank.

Test: atest com.android.server.display
Bug: 183001297
Bug: 183895829
Bug: 175806738
Bug: 185354618
Change-Id: Icae68121162ff72913ff72ea73261ec0f448f330
8 files changed