From 817f606392e4c6fbadc2a60d59c11378ea83b222 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Mon, 16 Aug 2021 12:15:11 -0700 Subject: Write displayOrientation value when WindowInfo is parceled The expected displayOrientation value was not being sent to other processes in WindowInfo because it was not being parceled/unparceled. Here, we ensure that the displayOrientation value is correctly parceled. Bug: 179274888 Test: adb shell dumpsys input Change-Id: Ic3e72a6ec45ffa0bd3a5b407389fccd7a5f036a6 --- libs/gui/WindowInfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/gui/WindowInfo.cpp') diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp index 6b68e1a93b..b2ef7aabc9 100644 --- a/libs/gui/WindowInfo.cpp +++ b/libs/gui/WindowInfo.cpp @@ -54,8 +54,8 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.frameLeft == frameLeft && info.frameTop == frameTop && info.frameRight == frameRight && info.frameBottom == frameBottom && info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor && - info.transform == transform && info.displayWidth == displayWidth && - info.displayHeight == displayHeight && + 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 && @@ -97,6 +97,7 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeFloat(transform.dtdy()) ?: parcel->writeFloat(transform.dsdy()) ?: parcel->writeFloat(transform.ty()) ?: + parcel->writeUint32(displayOrientation) ?: parcel->writeInt32(displayWidth) ?: parcel->writeInt32(displayHeight) ?: parcel->writeBool(visible) ?: @@ -154,6 +155,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { parcel->readFloat(&dtdy) ?: parcel->readFloat(&dsdy) ?: parcel->readFloat(&ty) ?: + parcel->readUint32(&displayOrientation) ?: parcel->readInt32(&displayWidth) ?: parcel->readInt32(&displayHeight) ?: parcel->readBool(&visible) ?: -- cgit v1.2.3-59-g8ed1b