Add hotplug support for primary display.

When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
This commit is contained in:
Michael Lentine 2015-05-12 18:04:26 -07:00
parent 5a16a62950
commit 10613dc3b5

View File

@ -305,13 +305,16 @@ void HWComposer::vsync(int disp, int64_t timestamp) {
} }
void HWComposer::hotplug(int disp, int connected) { void HWComposer::hotplug(int disp, int connected) {
if (disp == HWC_DISPLAY_PRIMARY || disp >= VIRTUAL_DISPLAY_ID_BASE) { if (disp >= VIRTUAL_DISPLAY_ID_BASE) {
ALOGE("hotplug event received for invalid display: disp=%d connected=%d", ALOGE("hotplug event received for invalid display: disp=%d connected=%d",
disp, connected); disp, connected);
return; return;
} }
queryDisplayProperties(disp); queryDisplayProperties(disp);
mEventHandler.onHotplugReceived(disp, bool(connected)); // Do not teardown or recreate the primary display
if (disp != HWC_DISPLAY_PRIMARY) {
mEventHandler.onHotplugReceived(disp, bool(connected));
}
} }
static float getDefaultDensity(uint32_t width, uint32_t height) { static float getDefaultDensity(uint32_t width, uint32_t height) {