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

Commit 5c1e4599 authored by Gil Dekel's avatar Gil Dekel
Browse files

DisplayIdentification: guard EDID IDs with stable_edid_ids()

Allow for the fabrication of EDID-based display IDs via the
stable_edid_ids() flag in DisplayIdentification.

Bug: 415036639
Flag: com.android.graphics.surfaceflinger.flags.stable_edid_ids
Test: presubmit
Change-Id: I64abf8c783b168126cfac6aa044adf9359f3feb8
parent acec0b1c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <string>
#include <string_view>

#include <common/FlagManager.h>
#include <ftl/concat.h>
#include <ftl/hash.h>
#include <log/log.h>
@@ -418,7 +419,9 @@ std::optional<DisplayIdentificationInfo> parseDisplayIdentificationData(
        return {};
    }

    const auto displayId = PhysicalDisplayId::fromEdid(port, edid->manufacturerId, edid->modelHash);
    const auto displayId = FlagManager::getInstance().stable_edid_ids()
            ? generateEdidDisplayId(*edid)
            : PhysicalDisplayId::fromEdid(port, edid->manufacturerId, edid->modelHash);
    return DisplayIdentificationInfo{
            .id = displayId,
            .name = std::string(edid->displayName),