WindowInfo: Cleanup reading from parcel
Bug: None
Test: atest libgui_test
Change-Id: Ie5724d990a8a6c1480be3cb1a457920db1c39689
diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp
index b02bae4..2312a8c 100644
--- a/libs/gui/WindowInfo.cpp
+++ b/libs/gui/WindowInfo.cpp
@@ -145,12 +145,14 @@
return status;
}
- layoutParamsFlags = Flags<Flag>(parcel->readInt32());
- layoutParamsType = static_cast<Type>(parcel->readInt32());
float dsdx, dtdx, tx, dtdy, dsdy, ty;
- int32_t touchOcclusionModeInt;
+ int32_t lpFlags, lpType, touchOcclusionModeInt, inputConfigInt;
+ sp<IBinder> touchableRegionCropHandleSp;
+
// clang-format off
- status = parcel->readInt32(&frameLeft) ?:
+ status = parcel->readInt32(&lpFlags) ?:
+ parcel->readInt32(&lpType) ?:
+ parcel->readInt32(&frameLeft) ?:
parcel->readInt32(&frameTop) ?:
parcel->readInt32(&frameRight) ?:
parcel->readInt32(&frameBottom) ?:
@@ -166,32 +168,28 @@
parcel->readInt32(&touchOcclusionModeInt) ?:
parcel->readInt32(&ownerPid) ?:
parcel->readInt32(&ownerUid) ?:
- parcel->readUtf8FromUtf16(&packageName);
- // clang-format on
-
- if (status != OK) {
- return status;
- }
-
- touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt);
-
- inputConfig = Flags<InputConfig>(parcel->readInt32());
- // clang-format off
- status = parcel->readInt32(&displayId) ?:
+ parcel->readUtf8FromUtf16(&packageName) ?:
+ parcel->readInt32(&inputConfigInt) ?:
+ parcel->readInt32(&displayId) ?:
applicationInfo.readFromParcel(parcel) ?:
parcel->read(touchableRegion) ?:
- parcel->readBool(&replaceTouchableRegionWithCrop);
+ parcel->readBool(&replaceTouchableRegionWithCrop) ?:
+ parcel->readNullableStrongBinder(&touchableRegionCropHandleSp) ?:
+ parcel->readNullableStrongBinder(&windowToken);
// clang-format on
if (status != OK) {
return status;
}
- touchableRegionCropHandle = parcel->readStrongBinder();
+ layoutParamsFlags = Flags<Flag>(lpFlags);
+ layoutParamsType = static_cast<Type>(lpType);
transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1});
+ touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt);
+ inputConfig = Flags<InputConfig>(inputConfigInt);
+ touchableRegionCropHandle = touchableRegionCropHandleSp;
- status = parcel->readNullableStrongBinder(&windowToken);
- return status;
+ return OK;
}
// --- WindowInfoHandle ---