diff options
| author | 2019-09-04 13:33:59 -0700 | |
|---|---|---|
| committer | 2019-09-04 13:33:59 -0700 | |
| commit | e199ca954dff7fdfb06e6280695d34a957ed5efc (patch) | |
| tree | 78be7fa3d9855c2a536e80ed4e7360845a968791 /libs/androidfw/DisplayEventDispatcher.cpp | |
| parent | 1bc876bb5b2b8506fe5e47421456c36ba4eefdea (diff) | |
| parent | 9e89d13906739e856ed809ba81c32415770717c6 (diff) | |
DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I9e3c4fe5406c9913d50fe3b07d7f7cef7a246b96
Diffstat (limited to 'libs/androidfw/DisplayEventDispatcher.cpp')
| -rw-r--r-- | libs/androidfw/DisplayEventDispatcher.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/androidfw/DisplayEventDispatcher.cpp b/libs/androidfw/DisplayEventDispatcher.cpp index 7708e4340397..660614895603 100644 --- a/libs/androidfw/DisplayEventDispatcher.cpp +++ b/libs/androidfw/DisplayEventDispatcher.cpp @@ -68,7 +68,7 @@ status_t DisplayEventDispatcher::scheduleVsync() { // Drain all pending events. nsecs_t vsyncTimestamp; - int32_t vsyncDisplayId; + PhysicalDisplayId vsyncDisplayId; uint32_t vsyncCount; if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) { ALOGE("dispatcher %p ~ last event processed while scheduling was for %" PRId64 "", @@ -101,10 +101,11 @@ int DisplayEventDispatcher::handleEvent(int, int events, void*) { // Drain all pending events, keep the last vsync. nsecs_t vsyncTimestamp; - int32_t vsyncDisplayId; + PhysicalDisplayId vsyncDisplayId; uint32_t vsyncCount; if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) { - ALOGV("dispatcher %p ~ Vsync pulse: timestamp=%" PRId64 ", id=%d, count=%d", + ALOGV("dispatcher %p ~ Vsync pulse: timestamp=%" PRId64 ", displayId=%" + ANDROID_PHYSICAL_DISPLAY_ID_FORMAT ", count=%d", this, ns2ms(vsyncTimestamp), vsyncDisplayId, vsyncCount); mWaitingForVsync = false; dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount); @@ -114,7 +115,7 @@ int DisplayEventDispatcher::handleEvent(int, int events, void*) { } bool DisplayEventDispatcher::processPendingEvents( - nsecs_t* outTimestamp, int32_t* outId, uint32_t* outCount) { + nsecs_t* outTimestamp, PhysicalDisplayId* outDisplayId, uint32_t* outCount) { bool gotVsync = false; DisplayEventReceiver::Event buf[EVENT_BUFFER_SIZE]; ssize_t n; @@ -128,11 +129,14 @@ bool DisplayEventDispatcher::processPendingEvents( // ones. That's fine, we only care about the most recent. gotVsync = true; *outTimestamp = ev.header.timestamp; - *outId = ev.header.id; + *outDisplayId = ev.header.displayId; *outCount = ev.vsync.count; break; case DisplayEventReceiver::DISPLAY_EVENT_HOTPLUG: - dispatchHotplug(ev.header.timestamp, ev.header.id, ev.hotplug.connected); + dispatchHotplug(ev.header.timestamp, ev.header.displayId, ev.hotplug.connected); + break; + case DisplayEventReceiver::DISPLAY_EVENT_CONFIG_CHANGED: + dispatchConfigChanged(ev.header.timestamp, ev.header.displayId, ev.config.configId); break; default: ALOGW("dispatcher %p ~ ignoring unknown event type %#x", this, ev.header.type); |