Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8601649 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Added windowToken to WindowInfo object" into sc-v2-dev am: f334812d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15532618

Change-Id: I80b0f711f5981511183d04325fa51af790e8bd43
parents fd1b0f5e f334812d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -114,7 +114,8 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const {
        applicationInfo.writeToParcel(parcel) ?:
        parcel->write(touchableRegion) ?:
        parcel->writeBool(replaceTouchableRegionWithCrop) ?:
        parcel->writeStrongBinder(touchableRegionCropHandle.promote());
        parcel->writeStrongBinder(touchableRegionCropHandle.promote()) ?:
        parcel->writeStrongBinder(windowToken);
    // clang-format on
    return status;
}
@@ -188,7 +189,8 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {
    touchableRegionCropHandle = parcel->readStrongBinder();
    transform.set({dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1});

    return OK;
    status = parcel->readNullableStrongBinder(&windowToken);
    return status;
}

// --- WindowInfoHandle ---
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,10 @@ struct WindowInfo : public Parcelable {
    // This value should NOT be used to uniquely identify the window. There may be different
    // input windows that have the same 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.
    int32_t id = -1;
    std::string name;
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ TEST(WindowInfo, Parcelling) {
    sp<IBinder> touchableRegionCropHandle = new BBinder();
    WindowInfo i;
    i.token = new BBinder();
    i.windowToken = new BBinder();
    i.id = 1;
    i.name = "Foobar";
    i.flags = WindowInfo::Flag::SLIPPERY;
@@ -85,6 +86,7 @@ TEST(WindowInfo, Parcelling) {
    WindowInfo i2;
    i2.readFromParcel(&p);
    ASSERT_EQ(i.token, i2.token);
    ASSERT_EQ(i.windowToken, i2.windowToken);
    ASSERT_EQ(i.id, i2.id);
    ASSERT_EQ(i.name, i2.name);
    ASSERT_EQ(i.flags, i2.flags);