diff options
Diffstat (limited to 'services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp b/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp index 98209bb9e4..83c2b2e789 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp @@ -25,6 +25,7 @@ #include <log/log.h> #include "DisplayIdentification.h" +#include "Hash.h" namespace android { namespace { @@ -262,8 +263,9 @@ std::optional<Edid> parseEdid(const DisplayIdentificationData& edid) { } // Hash model string instead of using product code or (integer) serial number, since the latter - // have been observed to change on some displays with multiple inputs. - const auto modelHash = static_cast<uint32_t>(std::hash<std::string_view>()(modelString)); + // have been observed to change on some displays with multiple inputs. Use a stable hash instead + // of std::hash which is only required to be same within a single execution of a program. + const uint32_t modelHash = static_cast<uint32_t>(cityHash64Len0To16(modelString)); // Parse extension blocks. std::optional<Cea861ExtensionBlock> cea861Block; |