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

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

Snap for 12488717 from 634adaca to 25Q1-release

Change-Id: I665fee558f219b0254000c4bb8b1ec886386155e
parents eca6593f 634adaca
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -38,10 +38,10 @@ $ adb shell uinput - < my-recording.evemu
### Timestamp bases

By default, event timestamps are recorded relative to the time of the first event received during
the recording. Passing `--timestamp-base=boot` causes the timestamps to be recorded relative to the
system boot time instead. While this does not affect the playback of the recording, it can be useful
for matching recorded events with other logs that use such timestamps, such as `dmesg` or the
touchpad gesture debug logs emitted by `TouchpadInputMapper`.
the recording. Passing `--timestamp-base=epoch` causes the timestamps to be recorded as Unix
timestamps, relative to the Unix epoch (00:00:00 UTC on 1st January 1970). While this does not
affect the playback of the recording, it can make the events in the recording easier to match up
with those from other log sources, like logcat.

[FreeDesktop]: https://gitlab.freedesktop.org/libevdev/evemu
[format]: https://gitlab.freedesktop.org/libevdev/evemu#device-description-format
+2 −1
Original line number Diff line number Diff line
@@ -299,7 +299,8 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor,

#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36
    if API_LEVEL_AT_LEAST (36, 202504) {
        if (codeToFunction != nullptr) {
        if (codeToFunction != nullptr &&
            (&AIBinder_Class_setTransactionCodeToFunctionNameMap != nullptr)) {
            AIBinder_Class_setTransactionCodeToFunctionNameMap(clazz, codeToFunction,
                                                               functionCount);
        }
+16 −1
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ struct InputReaderConfiguration {
        // The key remapping has changed.
        KEY_REMAPPING = 1u << 14,

        // The mouse settings changed, this includes mouse reverse vertical scrolling and swap
        // primary button.
        MOUSE_SETTINGS = 1u << 15,

        // All devices must be reopened.
        MUST_REOPEN = 1u << 31,
    };
@@ -252,6 +256,15 @@ struct InputReaderConfiguration {
    // Keycodes to be remapped.
    std::map<int32_t /* fromKeyCode */, int32_t /* toKeyCode */> keyRemapping;

    // True if the external mouse should have its vertical scrolling reversed, so that rotating the
    // wheel downwards scrolls the content upwards.
    bool mouseReverseVerticalScrollingEnabled;

    // True if the connected mouse should have its primary button (default: left click) swapped,
    // so that the right click will be the primary action button and the left click will be the
    // secondary action.
    bool mouseSwapPrimaryButtonEnabled;

    InputReaderConfiguration()
          : virtualKeyQuietTime(0),
            defaultPointerDisplayId(ui::LogicalDisplayId::DEFAULT),
@@ -282,7 +295,9 @@ struct InputReaderConfiguration {
            shouldNotifyTouchpadHardwareState(false),
            touchpadRightClickZoneEnabled(false),
            stylusButtonMotionEventsEnabled(true),
            stylusPointerIconEnabled(false) {}
            stylusPointerIconEnabled(false),
            mouseReverseVerticalScrollingEnabled(false),
            mouseSwapPrimaryButtonEnabled(false) {}

    std::optional<DisplayViewport> getDisplayViewportByType(ViewportType type) const;
    std::optional<DisplayViewport> getDisplayViewportByUniqueId(const std::string& uniqueDisplayId)
+3 −1
Original line number Diff line number Diff line
@@ -662,7 +662,9 @@ bool EventHub::Device::hasKeycodeLocked(int keycode) const {
    if (hasKeycodeInternalLocked(keycode)) {
        return true;
    }

    if (!keyMap.haveKeyCharacterMap()) {
        return false;
    }
    for (auto& fromKey : getKeyCharacterMap()->findKeyCodesMappedToKeyCode(keycode)) {
        if (hasKeycodeInternalLocked(fromKey)) {
            return true;
+15 −1
Original line number Diff line number Diff line
@@ -164,6 +164,10 @@ std::list<NotifyArgs> CursorInputMapper::reconfigure(nsecs_t when,
        changes.test(InputReaderConfiguration::Change::DISPLAY_INFO) || configurePointerCapture) {
        configureOnChangePointerSpeed(readerConfig);
    }

    if (!changes.any() || changes.test(InputReaderConfiguration::Change::MOUSE_SETTINGS)) {
        configureOnChangeMouseSettings(readerConfig);
    }
    return out;
}

@@ -275,7 +279,12 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
    PointerCoords pointerCoords;
    pointerCoords.clear();

    float vscroll = mCursorScrollAccumulator.getRelativeVWheel();
    // A negative value represents inverted scrolling direction.
    // Applies only if the source is a mouse.
    const bool isMouse =
            (mSource == AINPUT_SOURCE_MOUSE) || (mSource == AINPUT_SOURCE_MOUSE_RELATIVE);
    const int scrollingDirection = (mMouseReverseVerticalScrolling && isMouse) ? -1 : 1;
    float vscroll = scrollingDirection * mCursorScrollAccumulator.getRelativeVWheel();
    float hscroll = mCursorScrollAccumulator.getRelativeHWheel();
    bool scrolled = vscroll != 0 || hscroll != 0;

@@ -537,4 +546,9 @@ void CursorInputMapper::configureOnChangeDisplayInfo(const InputReaderConfigurat
    bumpGeneration();
}

void CursorInputMapper::configureOnChangeMouseSettings(const InputReaderConfiguration& config) {
    mMouseReverseVerticalScrolling = config.mouseReverseVerticalScrollingEnabled;
    mCursorButtonAccumulator.setSwapLeftRightButtons(config.mouseSwapPrimaryButtonEnabled);
}

} // namespace android
Loading