Skip to content

Commit ba6afd8

Browse files
committed
libs/ui: Remove getManufacturerId() from DisplayId
There are currently no clients of DisplayId who use getManufacturerId(). This CL removes the parsing and serving of the manufacturer's ID from DisplayID's API, together with the only client getPnpId(PhysicalDisplayId), which also isn't use in real use cases (only tests). See: go/edid-display-ids-al13 Flag: com.android.graphics.surfaceflinger.flags.stable_edid_ids Bug: 390689046 Test: Display{Id|Identification} & libsurfaceflinger_unittest Change-Id: I03db2f6d71b32fcb387e99d9bc2730ab21760012
1 parent 5aab65d commit ba6afd8

5 files changed

Lines changed: 0 additions & 19 deletions

File tree

libs/ui/DisplayIdentification.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,6 @@ std::optional<PnpId> getPnpId(uint16_t manufacturerId) {
392392
return a && b && c ? std::make_optional(PnpId{a, b, c}) : std::nullopt;
393393
}
394394

395-
std::optional<PnpId> getPnpId(PhysicalDisplayId displayId) {
396-
return getPnpId(displayId.getManufacturerId());
397-
}
398-
399395
std::optional<DisplayIdentificationInfo> parseDisplayIdentificationData(
400396
uint8_t port, const DisplayIdentificationData& data) {
401397
if (data.empty()) {

libs/ui/include/ui/DisplayId.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ struct PhysicalDisplayId : DisplayId {
9797
// TODO(b/162612135) Remove default constructor
9898
PhysicalDisplayId() = default;
9999

100-
constexpr uint16_t getManufacturerId() const { return static_cast<uint16_t>(value >> 40); }
101100
constexpr uint8_t getPort() const { return static_cast<uint8_t>(value); }
102101

103102
private:

libs/ui/include/ui/DisplayIdentification.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ struct Edid {
8585
bool isEdid(const DisplayIdentificationData&);
8686
std::optional<Edid> parseEdid(const DisplayIdentificationData&);
8787
std::optional<PnpId> getPnpId(uint16_t manufacturerId);
88-
std::optional<PnpId> getPnpId(PhysicalDisplayId);
8988

9089
std::optional<DisplayIdentificationInfo> parseDisplayIdentificationData(
9190
uint8_t port, const DisplayIdentificationData&);

libs/ui/tests/DisplayId_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ TEST(DisplayIdTest, createPhysicalIdFromEdid) {
2626
constexpr uint32_t modelHash = 42;
2727
const PhysicalDisplayId id = PhysicalDisplayId::fromEdid(port, manufacturerId, modelHash);
2828
EXPECT_EQ(port, id.getPort());
29-
EXPECT_EQ(manufacturerId, id.getManufacturerId());
3029
EXPECT_FALSE(VirtualDisplayId::tryCast(id));
3130
EXPECT_FALSE(HalVirtualDisplayId::tryCast(id));
3231
EXPECT_FALSE(GpuVirtualDisplayId::tryCast(id));

libs/ui/tests/DisplayIdentification_test.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -462,18 +462,6 @@ TEST(DisplayIdentificationTest, deviceProductInfo) {
462462
}
463463
}
464464

465-
TEST(DisplayIdentificationTest, fromPort) {
466-
// Manufacturer ID should be invalid.
467-
ASSERT_FALSE(getPnpId(PhysicalDisplayId::fromPort(0)));
468-
ASSERT_FALSE(getPnpId(PhysicalDisplayId::fromPort(0xffu)));
469-
}
470-
471-
TEST(DisplayIdentificationTest, getVirtualDisplayId) {
472-
// Manufacturer ID should be invalid.
473-
ASSERT_FALSE(getPnpId(getVirtualDisplayId(0)));
474-
ASSERT_FALSE(getPnpId(getVirtualDisplayId(0xffff'ffffu)));
475-
}
476-
477465
} // namespace android
478466

479467
// TODO(b/129481165): remove the #pragma below and fix conversion issues

0 commit comments

Comments
 (0)