[SF] Don't reset display state on reconnection

Currently we reset the display state when hotplug reconnect
is received for an already connected display. This is not
correct, instead the state has to be updated by DisplayManager.

This fixes a bug when config_maxUiWidth is set in frameworks/
base. In this case the framework sets the display viewport to
match the limited layer stack size but this setting is lost
after a hotplug.

Bug: 157549449
Test: build, flash, plug out and in the display, make sure the
          picture is still properly displayed
Change-Id: If8536963a4b912a6ff7d41a0fe54181cae35cc65
This commit is contained in:
Marin Shalamanov 2020-06-04 21:41:42 +02:00
parent b74fe1dc23
commit 4c5e301006

View file

@ -2674,7 +2674,8 @@ void SurfaceFlinger::processDisplayChanged(const wp<IBinder>& displayToken,
}
processDisplayAdded(displayToken, currentState);
if (currentState.physical) {
initializeDisplays();
const auto display = getDisplayDeviceLocked(displayToken);
setPowerModeInternal(display, hal::PowerMode::ON);
}
return;
}