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

Commit 9d7a8d29 authored by Gil Dekel's avatar Gil Dekel
Browse files

HWComposer: Relax port ID duplicate check

Recently, a fatal check guard was added in allocateVirtualDisplay()
against duplicate port IDs. This check seem to have uncovered an
pre-existing issue that causes a system crash on Comet while using an
external display.

We relax the fatal check guard while we investigate the issue to avoid
a full native crash.

Flag: EXEMPT bugfix
Bug: 412011951
Bug: 413414541
Test: HotplugTest#rejectsHotplugOnActivePortsDuplicate
Change-Id: I17a71b07b4f3e7f1c606fa9098b3497611263f0d
parent 3581ce1b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -229,9 +229,10 @@ bool HWComposer::allocateVirtualDisplay(HalVirtualDisplayId displayId, ui::Size

void HWComposer::allocatePhysicalDisplay(hal::HWDisplayId hwcDisplayId, PhysicalDisplayId displayId,
                                         uint8_t port, std::optional<ui::Size> physicalSize) {
    LOG_ALWAYS_FATAL_IF(!mActivePorts.try_emplace(port).second,
                        "Cannot attach display %" PRIu64 " to an already active port %" PRIu8 ".",
                        hwcDisplayId, port);
    // TODO: b/413414541 - turn this back to LOG_ALWAYS_FATAL_IF once the issue is resolved.
    ALOGE_IF(!mActivePorts.try_emplace(port).second,
             "Attaching display %" PRIu64 " to an already active port %" PRIu8 ".", hwcDisplayId,
             port);

    mPhysicalDisplayIdMap[hwcDisplayId] = displayId;