diff options
| author | 2023-06-21 22:10:03 +0000 | |
|---|---|---|
| committer | 2023-06-21 22:10:03 +0000 | |
| commit | 8a19cadc33e22e5177141d3de1d61b1e599e06fe (patch) | |
| tree | b07952699ba7b189cdaafee786a24b0a56a28bdf /libs/gui/WindowInfo.cpp | |
| parent | 65fc8649f1e80cd9e0cbc434561655802f34d8b0 (diff) | |
| parent | 042a7a0b193b832dbe080358bf9c1c7a78c16b95 (diff) | |
Merge "Use a strongly typed Uid in WindowInfo" into udc-qpr-dev am: 042a7a0b19
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/23620817
Change-Id: I3e03087d9aa239d1cc976287aef5c2b71dc991c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/gui/WindowInfo.cpp')
| -rw-r--r-- | libs/gui/WindowInfo.cpp | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp index 6df9ff1664..cd9b424e13 100644 --- a/libs/gui/WindowInfo.cpp +++ b/libs/gui/WindowInfo.cpp @@ -90,8 +90,9 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const {      }      parcel->writeInt32(1); -    // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. +    // Ensure that the size of custom types are what we expect for writing into the parcel.      static_assert(sizeof(inputConfig) == 4u); +    static_assert(sizeof(ownerUid.val()) == 4u);      // clang-format off      status_t status = parcel->writeStrongBinder(token) ?: @@ -116,7 +117,7 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const {          parcel->writeFloat(transform.ty()) ?:          parcel->writeInt32(static_cast<int32_t>(touchOcclusionMode)) ?:          parcel->writeInt32(ownerPid) ?: -        parcel->writeInt32(ownerUid) ?: +        parcel->writeInt32(ownerUid.val()) ?:          parcel->writeUtf8AsUtf16(packageName) ?:          parcel->writeInt32(inputConfig.get()) ?:          parcel->writeInt32(displayId) ?: @@ -147,7 +148,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {      }      float dsdx, dtdx, tx, dtdy, dsdy, ty; -    int32_t lpFlags, lpType, touchOcclusionModeInt, inputConfigInt; +    int32_t lpFlags, lpType, touchOcclusionModeInt, inputConfigInt, ownerUidInt;      sp<IBinder> touchableRegionCropHandleSp;      // clang-format off @@ -168,7 +169,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {          parcel->readFloat(&ty) ?:          parcel->readInt32(&touchOcclusionModeInt) ?:          parcel->readInt32(&ownerPid) ?: -        parcel->readInt32(&ownerUid) ?: +        parcel->readInt32(&ownerUidInt) ?:          parcel->readUtf8FromUtf16(&packageName) ?:          parcel->readInt32(&inputConfigInt) ?:          parcel->readInt32(&displayId) ?: @@ -190,6 +191,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {      transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1});      touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt);      inputConfig = ftl::Flags<InputConfig>(inputConfigInt); +    ownerUid = Uid{static_cast<uid_t>(ownerUidInt)};      touchableRegionCropHandle = touchableRegionCropHandleSp;      return OK; |