Loading libs/gui/WindowInfo.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -114,7 +114,8 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { applicationInfo.writeToParcel(parcel) ?: applicationInfo.writeToParcel(parcel) ?: parcel->write(touchableRegion) ?: parcel->write(touchableRegion) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: parcel->writeStrongBinder(touchableRegionCropHandle.promote()); parcel->writeStrongBinder(touchableRegionCropHandle.promote()) ?: parcel->writeStrongBinder(windowToken); // clang-format on // clang-format on return status; return status; } } Loading Loading @@ -188,7 +189,8 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { touchableRegionCropHandle = parcel->readStrongBinder(); touchableRegionCropHandle = parcel->readStrongBinder(); transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1}); transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1}); return OK; status = parcel->readNullableStrongBinder(&windowToken); return status; } } // --- WindowInfoHandle --- // --- WindowInfoHandle --- Loading libs/gui/include/gui/WindowInfo.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,10 @@ struct WindowInfo : public Parcelable { // This value should NOT be used to uniquely identify the window. There may be different // This value should NOT be used to uniquely identify the window. There may be different // input windows that have the same token. // input windows that have the same token. sp<IBinder> token; sp<IBinder> token; // The token that identifies which client window this WindowInfo was created for. sp<IBinder> windowToken; // This uniquely identifies the input window. // This uniquely identifies the input window. int32_t id = -1; int32_t id = -1; std::string name; std::string name; Loading libs/gui/tests/WindowInfo_test.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ TEST(WindowInfo, Parcelling) { sp<IBinder> touchableRegionCropHandle = new BBinder(); sp<IBinder> touchableRegionCropHandle = new BBinder(); WindowInfo i; WindowInfo i; i.token = new BBinder(); i.token = new BBinder(); i.windowToken = new BBinder(); i.id = 1; i.id = 1; i.name = "Foobar"; i.name = "Foobar"; i.flags = WindowInfo::Flag::SLIPPERY; i.flags = WindowInfo::Flag::SLIPPERY; Loading Loading @@ -85,6 +86,7 @@ TEST(WindowInfo, Parcelling) { WindowInfo i2; WindowInfo i2; i2.readFromParcel(&p); i2.readFromParcel(&p); ASSERT_EQ(i.token, i2.token); ASSERT_EQ(i.token, i2.token); ASSERT_EQ(i.windowToken, i2.windowToken); ASSERT_EQ(i.id, i2.id); ASSERT_EQ(i.id, i2.id); ASSERT_EQ(i.name, i2.name); ASSERT_EQ(i.name, i2.name); ASSERT_EQ(i.flags, i2.flags); ASSERT_EQ(i.flags, i2.flags); Loading Loading
libs/gui/WindowInfo.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -114,7 +114,8 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { applicationInfo.writeToParcel(parcel) ?: applicationInfo.writeToParcel(parcel) ?: parcel->write(touchableRegion) ?: parcel->write(touchableRegion) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: parcel->writeStrongBinder(touchableRegionCropHandle.promote()); parcel->writeStrongBinder(touchableRegionCropHandle.promote()) ?: parcel->writeStrongBinder(windowToken); // clang-format on // clang-format on return status; return status; } } Loading Loading @@ -188,7 +189,8 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { touchableRegionCropHandle = parcel->readStrongBinder(); touchableRegionCropHandle = parcel->readStrongBinder(); transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1}); transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1}); return OK; status = parcel->readNullableStrongBinder(&windowToken); return status; } } // --- WindowInfoHandle --- // --- WindowInfoHandle --- Loading
libs/gui/include/gui/WindowInfo.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,10 @@ struct WindowInfo : public Parcelable { // This value should NOT be used to uniquely identify the window. There may be different // This value should NOT be used to uniquely identify the window. There may be different // input windows that have the same token. // input windows that have the same token. sp<IBinder> token; sp<IBinder> token; // The token that identifies which client window this WindowInfo was created for. sp<IBinder> windowToken; // This uniquely identifies the input window. // This uniquely identifies the input window. int32_t id = -1; int32_t id = -1; std::string name; std::string name; Loading
libs/gui/tests/WindowInfo_test.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ TEST(WindowInfo, Parcelling) { sp<IBinder> touchableRegionCropHandle = new BBinder(); sp<IBinder> touchableRegionCropHandle = new BBinder(); WindowInfo i; WindowInfo i; i.token = new BBinder(); i.token = new BBinder(); i.windowToken = new BBinder(); i.id = 1; i.id = 1; i.name = "Foobar"; i.name = "Foobar"; i.flags = WindowInfo::Flag::SLIPPERY; i.flags = WindowInfo::Flag::SLIPPERY; Loading Loading @@ -85,6 +86,7 @@ TEST(WindowInfo, Parcelling) { WindowInfo i2; WindowInfo i2; i2.readFromParcel(&p); i2.readFromParcel(&p); ASSERT_EQ(i.token, i2.token); ASSERT_EQ(i.token, i2.token); ASSERT_EQ(i.windowToken, i2.windowToken); ASSERT_EQ(i.id, i2.id); ASSERT_EQ(i.id, i2.id); ASSERT_EQ(i.name, i2.name); ASSERT_EQ(i.name, i2.name); ASSERT_EQ(i.flags, i2.flags); ASSERT_EQ(i.flags, i2.flags); Loading