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

Commit f24d8d6d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes If3d6ea21,Iab8360f2

* changes:
  WindowInfo: Remove unused field portalToDisplayId
  InputDispatcher: Allow spy window to receive entire gesture after pilfer
parents 109f3c00 1c58c0d9
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const {
            info.hasWallpaper == hasWallpaper && info.paused == paused &&
            info.ownerPid == ownerPid && info.ownerUid == ownerUid &&
            info.packageName == packageName && info.inputFeatures == inputFeatures &&
            info.displayId == displayId && info.portalToDisplayId == portalToDisplayId &&
            info.displayId == displayId &&
            info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop &&
            info.applicationInfo == applicationInfo;
}
@@ -116,7 +116,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const {
        parcel->writeUtf8AsUtf16(packageName) ?:
        parcel->writeInt32(inputFeatures.get()) ?:
        parcel->writeInt32(displayId) ?:
        parcel->writeInt32(portalToDisplayId) ?:
        applicationInfo.writeToParcel(parcel) ?:
        parcel->write(touchableRegion) ?:
        parcel->writeBool(replaceTouchableRegionWithCrop) ?:
@@ -180,7 +179,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {
    inputFeatures = Flags<Feature>(parcel->readInt32());
    // clang-format off
    status = parcel->readInt32(&displayId) ?:
        parcel->readInt32(&portalToDisplayId) ?:
        applicationInfo.readFromParcel(parcel) ?:
        parcel->read(touchableRegion) ?:
        parcel->readBool(&replaceTouchableRegionWithCrop);
+0 −1
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ struct WindowInfo : public Parcelable {
    std::string packageName;
    Flags<Feature> inputFeatures;
    int32_t displayId = ADISPLAY_ID_NONE;
    int32_t portalToDisplayId = ADISPLAY_ID_NONE;
    InputApplicationInfo applicationInfo;
    bool replaceTouchableRegionWithCrop = false;
    wp<IBinder> touchableRegionCropHandle;
+0 −2
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ TEST(WindowInfo, Parcelling) {
    i.packageName = "com.example.package";
    i.inputFeatures = WindowInfo::Feature::DISABLE_USER_ACTIVITY;
    i.displayId = 34;
    i.portalToDisplayId = 2;
    i.replaceTouchableRegionWithCrop = true;
    i.touchableRegionCropHandle = touchableRegionCropHandle;
    i.applicationInfo.name = "ApplicationFooBar";
@@ -107,7 +106,6 @@ TEST(WindowInfo, Parcelling) {
    ASSERT_EQ(i.packageName, i2.packageName);
    ASSERT_EQ(i.inputFeatures, i2.inputFeatures);
    ASSERT_EQ(i.displayId, i2.displayId);
    ASSERT_EQ(i.portalToDisplayId, i2.portalToDisplayId);
    ASSERT_EQ(i.replaceTouchableRegionWithCrop, i2.replaceTouchableRegionWithCrop);
    ASSERT_EQ(i.touchableRegionCropHandle, i2.touchableRegionCropHandle);
    ASSERT_EQ(i.applicationInfo, i2.applicationInfo);
+3 −3
Original line number Diff line number Diff line
@@ -1987,7 +1987,7 @@ InputEventInjectionResult InputDispatcher::findTouchedWindowTargetsLocked(
    TouchState tempTouchState;
    if (const auto it = mTouchStatesByDisplay.find(displayId); it != mTouchStatesByDisplay.end()) {
        oldState = &(it->second);
        tempTouchState.copyFrom(*oldState);
        tempTouchState = *oldState;
    }

    bool isSplit = tempTouchState.split;
@@ -5530,9 +5530,9 @@ status_t InputDispatcher::pilferPointers(const sp<IBinder>& token) {
    ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(),
          canceledWindows.c_str());

    // Then clear the current touch state so we stop dispatching to them as well.
    state.split = false;
    // Prevent the gesture from being sent to any other windows.
    state.filterWindowsExcept(token);
    state.preventNewTargets = true;
    return OK;
}

+3 −20
Original line number Diff line number Diff line
@@ -25,27 +25,8 @@ using android::gui::WindowInfoHandle;

namespace android::inputdispatcher {

TouchState::TouchState()
      : down(false), split(false), deviceId(-1), source(0), displayId(ADISPLAY_ID_NONE) {}

TouchState::~TouchState() {}

void TouchState::reset() {
    down = false;
    split = false;
    deviceId = -1;
    source = 0;
    displayId = ADISPLAY_ID_NONE;
    windows.clear();
}

void TouchState::copyFrom(const TouchState& other) {
    down = other.down;
    split = other.split;
    deviceId = other.deviceId;
    source = other.source;
    displayId = other.displayId;
    windows = other.windows;
    *this = TouchState();
}

void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int32_t targetFlags,
@@ -66,6 +47,8 @@ void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int
        }
    }

    if (preventNewTargets) return; // Don't add new TouchedWindows.

    TouchedWindow touchedWindow;
    touchedWindow.windowHandle = windowHandle;
    touchedWindow.targetFlags = targetFlags;
Loading