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

Commit 9414c2ae authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11710546 from 594dde0e to 24Q3-release

Change-Id: I7be87cf6c3ca2f383168f6e3bb2498d6e82db16c
parents 4c2343a9 594dde0e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -135,7 +135,13 @@ flag {
  description: "Enable prediction pruning based on jerk thresholds."
  bug: "266747654"
  is_fixed_read_only: true
}

flag {
  name: "device_associations"
  namespace: "input"
  description: "Binds InputDevice name and InputDevice description against display unique id."
  bug: "324075859"
}

flag {
+2 −2
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "CtsWindowManagerDeviceWindow",
      "name": "CtsWindowManagerDeviceInput",
      "options": [
        {
          "include-filter": "android.server.wm.window.WindowInputTests"
          "include-filter": "android.server.wm.input.WindowInputTests"
        }
      ]
    },
+3 −3
Original line number Diff line number Diff line
@@ -2455,7 +2455,7 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
        if (newTouchedWindowHandle == nullptr) {
            ALOGD("No new touched window at (%.1f, %.1f) in display %" PRId32, x, y, displayId);
            // Try to assign the pointer to the first foreground window we find, if there is one.
            newTouchedWindowHandle = tempTouchState.getFirstForegroundWindowHandle();
            newTouchedWindowHandle = tempTouchState.getFirstForegroundWindowHandle(entry.deviceId);
        }

        // Verify targeted injection.
@@ -2623,7 +2623,7 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
            const auto [x, y] = resolveTouchedPosition(entry);
            const bool isStylus = isPointerFromStylus(entry, /*pointerIndex=*/0);
            sp<WindowInfoHandle> oldTouchedWindowHandle =
                    tempTouchState.getFirstForegroundWindowHandle();
                    tempTouchState.getFirstForegroundWindowHandle(entry.deviceId);
            LOG_ALWAYS_FATAL_IF(oldTouchedWindowHandle == nullptr);
            sp<WindowInfoHandle> newTouchedWindowHandle =
                    findTouchedWindowAtLocked(displayId, x, y, isStylus);
@@ -2741,7 +2741,7 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
    // has a different UID, then we will not reveal coordinate information to this window.
    if (maskedAction == AMOTION_EVENT_ACTION_DOWN) {
        sp<WindowInfoHandle> foregroundWindowHandle =
                tempTouchState.getFirstForegroundWindowHandle();
                tempTouchState.getFirstForegroundWindowHandle(entry.deviceId);
        if (foregroundWindowHandle) {
            const auto foregroundWindowUid = foregroundWindowHandle->getInfo()->ownerUid;
            for (InputTarget& target : targets) {
+5 −3
Original line number Diff line number Diff line
@@ -180,9 +180,11 @@ void TouchState::cancelPointersForNonPilferingWindows() {
    clearWindowsWithoutPointers();
}

sp<WindowInfoHandle> TouchState::getFirstForegroundWindowHandle() const {
    for (size_t i = 0; i < windows.size(); i++) {
        const TouchedWindow& window = windows[i];
sp<WindowInfoHandle> TouchState::getFirstForegroundWindowHandle(DeviceId deviceId) const {
    for (const auto& window : windows) {
        if (!window.hasTouchingPointers(deviceId)) {
            continue;
        }
        if (window.targetFlags.test(InputTarget::Flags::FOREGROUND)) {
            return window.windowHandle;
        }
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ struct TouchState {
    // set to false.
    void cancelPointersForNonPilferingWindows();

    sp<android::gui::WindowInfoHandle> getFirstForegroundWindowHandle() const;
    sp<android::gui::WindowInfoHandle> getFirstForegroundWindowHandle(DeviceId deviceId) const;
    bool isSlippery() const;
    sp<android::gui::WindowInfoHandle> getWallpaperWindow() const;
    const TouchedWindow& getTouchedWindow(
Loading