SurfaceFlinger: fix invalid PhysicalDisplayId in onConfigChanged event
A conversion error (uint64_t -> uint32_t) was causing a trunction
of displayId value which lead to invalid displayId in onConfigChanged.
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Bug: 129159940
Change-Id: I9d24cac0b9e74c7b20421d2b7d9fd65c16cca9e1
diff --git a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
index 406ec81..249c78f 100644
--- a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
+++ b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
@@ -38,6 +38,7 @@
constexpr PhysicalDisplayId INTERNAL_DISPLAY_ID = 111;
constexpr PhysicalDisplayId EXTERNAL_DISPLAY_ID = 222;
+constexpr PhysicalDisplayId DISPLAY_ID_64BIT = 0xabcd12349876fedcULL;
class MockVSyncSource : public VSyncSource {
public:
@@ -470,5 +471,10 @@
expectConfigChangedEventReceivedByConnection(EXTERNAL_DISPLAY_ID, 5);
}
+TEST_F(EventThreadTest, postConfigChangedPrimary64bit) {
+ mThread->onConfigChanged(DISPLAY_ID_64BIT, 7);
+ expectConfigChangedEventReceivedByConnection(DISPLAY_ID_64BIT, 7);
+}
+
} // namespace
} // namespace android