Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f90abbe authored by Steven Thomas's avatar Steven Thomas Committed by android-build-merger
Browse files

Merge "Fix frozen screen after exiting vr" into pi-dev

am: 012d6b42

Change-Id: I4cedfdaed24afb6adc29b564d7b02b82902185ca
parents 670bf573 012d6b42
Loading
Loading
Loading
Loading
+23 −23
Original line number Diff line number Diff line
@@ -144,15 +144,16 @@ void Device::destroyDisplay(hwc2_display_t displayId)

void Device::onHotplug(hwc2_display_t displayId, Connection connection) {
    if (connection == Connection::Connected) {
        auto display = getDisplayById(displayId);
        if (display) {
            if (display->isConnected()) {
                ALOGW("Attempt to hotplug connect display %" PRIu64
                        " , which is already connected.", displayId);
            } else {
                display->setConnected(true);
        // If we get a hotplug connected event for a display we already have,
        // destroy the display and recreate it. This will force us to requery
        // the display params and recreate all layers on that display.
        auto oldDisplay = getDisplayById(displayId);
        if (oldDisplay != nullptr && oldDisplay->isConnected()) {
            ALOGI("Hotplug connecting an already connected display."
                    " Clearing old display state.");
        }
        } else {
        mDisplays.erase(displayId);

        DisplayType displayType;
        auto intError = mComposer->getDisplayType(displayId,
                reinterpret_cast<Hwc2::IComposerClient::DisplayType *>(
@@ -168,7 +169,6 @@ void Device::onHotplug(hwc2_display_t displayId, Connection connection) {
        auto newDisplay = std::make_unique<Display>(
                *mComposer.get(), mCapabilities, displayId, displayType);
        mDisplays.emplace(displayId, std::move(newDisplay));
        }
    } else if (connection == Connection::Disconnected) {
        // The display will later be destroyed by a call to
        // destroyDisplay(). For now we just mark it disconnected.
+10 −10
Original line number Diff line number Diff line
@@ -2120,9 +2120,8 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
        getBE().mHwc->onHotplug(event.display, displayType, event.connection);

        if (event.connection == HWC2::Connection::Connected) {
            if (!mBuiltinDisplays[displayType].get()) {
                ALOGV("Creating built in display %d", displayType);
            ALOGW_IF(mBuiltinDisplays[displayType],
                    "Overwriting display token for display type %d", displayType);
                mBuiltinDisplays[displayType] = new BBinder();
                // All non-virtual displays are currently considered secure.
                DisplayDeviceState info(displayType, true);
@@ -2130,6 +2129,7 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
                        "Built-in Screen" : "External Screen";
                mCurrentState.displays.add(mBuiltinDisplays[displayType], info);
                mInterceptor.saveDisplayCreation(info);
            }
        } else {
            ALOGV("Removing built in display %d", displayType);