Report gui::DisplayInfo to clients with window info changes
InputFlinger needs to know specifications about displays such as
orientation and projection from SurfaceFlinger to support the
MotionEvent#getRaw API, which returns coordinates in logical display
space at the moment.
Since dispatcher gets window information from SF, we need to send the
display information that affects input dispatching at the same time as
updating window information to ensure those two pieces of information
remain in sync.
Instead of sending display information along with each window, we
attempt to reduce the amount of information sent through binder by
sending DisplayInfo separately to WindowInfos. The newly added
DisplayInfo struct should only be used by InputFlinger to support raw
coordinates for now, with the goal of removing it altogether in the
future.
Bug: 179274888
Test: atest libgui_test inputflinger_tests
Test: manual, ensure input works
Change-Id: I87429ca4ced5f105f49a117c676cba29f8a5c4da
diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp
index b2ef7aa..5f3a726 100644
--- a/libs/gui/WindowInfo.cpp
+++ b/libs/gui/WindowInfo.cpp
@@ -54,12 +54,11 @@
info.frameLeft == frameLeft && info.frameTop == frameTop &&
info.frameRight == frameRight && info.frameBottom == frameBottom &&
info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor &&
- info.transform == transform && info.displayOrientation == displayOrientation &&
- info.displayWidth == displayWidth && info.displayHeight == displayHeight &&
- info.touchableRegion.hasSameRects(touchableRegion) && info.visible == visible &&
- info.trustedOverlay == trustedOverlay && info.focusable == focusable &&
- info.touchOcclusionMode == touchOcclusionMode && info.hasWallpaper == hasWallpaper &&
- info.paused == paused && info.ownerPid == ownerPid && info.ownerUid == ownerUid &&
+ info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) &&
+ info.visible == visible && info.trustedOverlay == trustedOverlay &&
+ info.focusable == focusable && info.touchOcclusionMode == touchOcclusionMode &&
+ info.hasWallpaper == hasWallpaper && info.paused == paused &&
+ info.ownerPid == ownerPid && info.ownerUid == ownerUid &&
info.packageName == packageName && info.inputFeatures == inputFeatures &&
info.displayId == displayId && info.portalToDisplayId == portalToDisplayId &&
info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop &&
@@ -97,9 +96,6 @@
parcel->writeFloat(transform.dtdy()) ?:
parcel->writeFloat(transform.dsdy()) ?:
parcel->writeFloat(transform.ty()) ?:
- parcel->writeUint32(displayOrientation) ?:
- parcel->writeInt32(displayWidth) ?:
- parcel->writeInt32(displayHeight) ?:
parcel->writeBool(visible) ?:
parcel->writeBool(focusable) ?:
parcel->writeBool(hasWallpaper) ?:
@@ -155,9 +151,6 @@
parcel->readFloat(&dtdy) ?:
parcel->readFloat(&dsdy) ?:
parcel->readFloat(&ty) ?:
- parcel->readUint32(&displayOrientation) ?:
- parcel->readInt32(&displayWidth) ?:
- parcel->readInt32(&displayHeight) ?:
parcel->readBool(&visible) ?:
parcel->readBool(&focusable) ?:
parcel->readBool(&hasWallpaper) ?: