Skip to content
Snippets Groups Projects
  1. May 24, 2023
    • Siarhei Vishniakou's avatar
      Add a unit test for TouchpadInputMapper · 979f2d8a
      Siarhei Vishniakou authored
      This test will provide RawEvent's to TouchpadInputMapper and will look
      at the returned events.
      
      The main purpose of this CL is to document the existing behaviour of
      CursorInputMapper and TouchpadInputMapper. The tests highlights that
      today, dispatcher must handle the case where the touch starts without
      HOVER_EXIT. That means that the dispatcher logs of "conflicting pointer
      actions" can be mostly ignored.
      
      The goal was to make the tests for the two mappers as similar to each
      other as possible.
      
      A slightly different testing infra is introduced here compared to the
      one used in InputReader_test.
      
      Changes:
      * Use mocks for interfaces instead of constructed objects
      This helps figure out which parts are important to mock for a specific
      test vs which ones are not. When a function is called with a parameters
      that the mocks aren't expecting, a warning is printed during test run.
      This helps identify the complete state needed in order for the test to
      execute.
      
      * No longer require InstrumentedInputReader
      
      * No longer require a listener. We only check the events that are coming
        from the 'process' call, which is what the interface for the mapper
        does.
      
      Limitations:
      * Still require an InputDevice object to be constructed in order to test
        InputMappers. Ideally, a mapper would only depend on the EventHub
        state (to read the current value of keys / axes after a reset).
      
      Bug: 263319225
      Test: m inputflinger_tests && $ANDROID_HOST_OUT/nativetest64/inputflinger_tests/inputflinger_tests --gtest_filter="*HoverAndLeftButtonPress*"
      Change-Id: I7de0dee7abcf6bcb9d3283e29d9a85de2f331a44
      979f2d8a
  2. May 18, 2023
    • Brian Duddie's avatar
      Fix NDK documentation for ASensorEvent · 2c5692bd
      Brian Duddie authored
      Correctly associate comments with the applicable fields by moving the
      comment to before the field declaration.
      
      Fixes: 283307966
      Test: presubmit
      Change-Id: Ibb87216f5d0deb458248df8989fdfeed79edf0e4
      2c5692bd
  3. May 16, 2023
    • Siarhei Vishniakou's avatar
      Create InputTarget in a separate function · 6c377b36
      Siarhei Vishniakou authored
      To make the code more readable and reusable, move the creation of
      InputTarget into a separate function.
      
      In a future commit, the new function ' createInputTargetLocked' will be
      needed in other places of InputDispatcher, too.
      
      Bug: 263319225
      Test: m inputflinger_tests && $ANDROID_HOST_OUT/nativetest64/inputflinger_tests/inputflinger_tests
      Change-Id: Iae78c7c812afe5bb059c56669a3de00fdfc496ef
      6c377b36
  4. May 12, 2023
  5. Apr 28, 2023
  6. Apr 24, 2023
    • Siarhei Vishniakou's avatar
      Use std::unordered_map in KeyCharacterMap · 2a916c46
      Siarhei Vishniakou authored
      Previously, KeyedVector was used in KeyCharacterMap. Convert this to the
      std::unordered_map.
      
      Bug: 278299254
      Test: m checkinput
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      Change-Id: I643aa8cc8ae0c68ade4d11d02e34be64faf7f157
      2a916c46
  7. Apr 20, 2023
    • Vaibhav Devmurari's avatar
      Force input device changed callback when Keyboard layout info is updated · 0a6fee80
      Vaibhav Devmurari authored
      Virtual keyboard creation uses KEYBOARD_LAYOUT_ASSOCIATION reconfig to
      associated input device with keyboard layout info. But this can
      happen after input device added (Race condition between device creation
      and input device added callback.)
      If input device already added then we sometimes don't get input device
      changed callback since the generation is same.
      
      Test: atest VirtualKeyboardLayoutTest
      Bug: 277778640
      Change-Id: I218b6d797da27ec3a383fbcd2ebeacb0afbf5fab
      0a6fee80
  8. Apr 19, 2023
  9. Apr 18, 2023
    • Dominik Laskowski's avatar
      SF: Clean up ftl::SmallMap lookup fallbacks · 80872bdd
      Dominik Laskowski authored
      Avoid std::cref to a local variable, which is not intuitive and incurs
      construction in the non-fallback case.
      
      Bug: 185536303
      Test: ftl_test
      Change-Id: I1c5a94bdab105a04f8230fe762bdc433eea5c97a
      80872bdd
    • Prabir Pradhan's avatar
      ftl_flags: Add default parameter to any() · 12f8913b
      Prabir Pradhan authored
      Add a default parameter to any() so that we can easily test if any of
      the bits in the bitfield have been set.
      
      Bug: 245989146
      Test: atest ftl_test
      Change-Id: Ibee03c2f70288d1a353e1d86539fb7f88b1e5d3c
      12f8913b
    • Biswarup Pal's avatar
      Pass virtual input event timestamps to uinput · e9fe2dfd
      Biswarup Pal authored
      Test: Verify that virtual input timestamps are propagated to EventHub correctly, provided that uinput supports event timestamps
      Bug: 271946580
      Change-Id: Ifb79654000e1040ccfb85d35dee856a24db5eb73
      e9fe2dfd
  10. Apr 17, 2023
    • Siarhei Vishniakou's avatar
      Return Key* from getKey · 0bae1a0f
      Siarhei Vishniakou authored
      The call getKey can fail. Rather than returning a separate bool that the
      caller might ignore, return a pointer to simplify the code.
      
      Bug: 278299254
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      Change-Id: I28c25bee8890bdc90ca7e069c803423a7420e6b4
      0bae1a0f
    • Siarhei Vishniakou's avatar
      Pass reference to finishKey · 5af2834b
      Siarhei Vishniakou authored
      Since the parameter is assumed to be non-null, pass it by reference.
      
      Bug: 274058082
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      Change-Id: Iedf8970a57e4463e6addc8ee1013feb3ee60c009
      5af2834b
  11. Apr 14, 2023
    • Greg Pataky's avatar
      input: Cleanup doxygen linking · e153adc9
      Greg Pataky authored
      This goes through the file and adds either `#` or `{@link ...}` doxygen
      linkage for all enum values, types, and functions to allow deep linking
      to be generated.
      
      Test: `development/tools/ndk/build_ndk_docs.py` and manual inspection of the generated doc.
      Change-Id: I0b6a154c9ba2cb4749d007b22088675667b6d7b4
      e153adc9
  12. Apr 13, 2023
  13. Apr 11, 2023
  14. Apr 06, 2023
    • Cody Heiner's avatar
      Add outputLength method · dbd14eb7
      Cody Heiner authored
      Test: build succeeds, `atest libinput-tests` passes.
      
      Bug: 268245099
      
      Change-Id: I030da703a907eef44e85d186144eddc53b5998cc
      dbd14eb7
  15. Mar 31, 2023
    • Charles Lin's avatar
      hasKeycodeLocked() also checks usage codes · aadf8d5c
      Charles Lin authored
      Key map can use both scan code and usage code.
      Adding usage code check to avoid misjudgment.
      
      Bug: 275526611
      Test:
      In Android TV, pairing a BT RCU with keylayout which
      has usage page/id for DPAD. In PlayStore app search
      box, make sure user can move focus to search result
      by pressing dpad DOWN key.
      
      Change-Id: I70687d308899537e457192458176b1553c350f14
      aadf8d5c
  16. Mar 28, 2023
  17. Mar 16, 2023
  18. Mar 14, 2023
    • Harry Cutts's avatar
      input: use optionals for PropertyMap getters · f13161a1
      Harry Cutts authored
      Using optionals rather than returning a boolean forces the caller to
      check whether the property is present, enforced by the compiler, and
      also allows a more succinct syntax in some cases.
      
      Bug: 245989146
      Test: atest inputflinger_test
      Test: connect Apple Magic Trackpad 2, check that gesture properties are
            set correctly in dumpsys input
      Change-Id: Ia0fde1f67269e6e7149f297def626e572fd7790f
      f13161a1
  19. Mar 13, 2023
  20. Mar 10, 2023
    • Prabir Pradhan's avatar
      MotionEvent: Round coordinates to a precision of 0.001 · 0909dc1c
      Prabir Pradhan authored
      When tests inject input events at a location on the screen, the
      dispatched event is expected to have the same coordinates. However, on
      scaled devices, this may not always be the case due to precision losses
      incurred through floating point arithmetics. For example, it was
      possible for an injected event with a coordinate of 1.0 to end up with
      a value of 0.9997.
      
      To combat this issue, we will round transformed axis values that are
      leaving a MotionEvent to a precision of 0.001. After this CL, even if
      the injection process results in precision losses, they should be
      overcome by rounding, assuming injection does not require greater
      precision.
      
      This will solve the issue where input injected to an inclusive edge of
      the View bounds was not getting dispatched to the View due to precision
      losses.
      
      Bug: 264978231
      Bug: 260965930
      Test: atest libinput_tests
      Test: atest inputflinger_tests
      Test: atest HoverTest (with screen size override)
      Change-Id: I81062597058361a1218e6873d34b9b0d2fbfad96
      Merged-In: I81062597058361a1218e6873d34b9b0d2fbfad96
      0909dc1c
    • Prabir Pradhan's avatar
      MotionEvent: Round coordinates to a precision of 0.001 · 00e029d8
      Prabir Pradhan authored
      When tests inject input events at a location on the screen, the
      dispatched event is expected to have the same coordinates. However, on
      scaled devices, this may not always be the case due to precision losses
      incurred through floating point arithmetics. For example, it was
      possible for an injected event with a coordinate of 1.0 to end up with
      a value of 0.9997.
      
      To combat this issue, we will round transformed axis values that are
      leaving a MotionEvent to a precision of 0.001. After this CL, even if
      the injection process results in precision losses, they should be
      overcome by rounding, assuming injection does not require greater
      precision.
      
      This will solve the issue where input injected to an inclusive edge of
      the View bounds was not getting dispatched to the View due to precision
      losses.
      
      Bug: 264978231
      Bug: 260965930
      Test: atest libinput_tests
      Test: atest inputflinger_tests
      Test: atest HoverTest (with screen size override)
      Change-Id: I81062597058361a1218e6873d34b9b0d2fbfad96
      00e029d8
    • Sebastian Pickl's avatar
      Revert "Support touchpad gesture properties in IDC files" · a53cb97a
      Sebastian Pickl authored
      Revert submission 21750284-touchpad-specific-tuning
      
      Reason for revert: resolves flake b/272308130 according to culprit assistant https://android-build.googleplex.com/builds/culprit-assistant/run/6257e5da-1bb0-437a-8fab-f04c27d462b3 verified by 6 runs in abtd https://android-build.googleplex.com/builds/abtd/run/L75900000959044402
      
      Reverted changes: /q/submissionid:21750284-touchpad-specific-tuning
      
      Change-Id: I62078104a96d588bd321459e5a069dd0de5933bd
      a53cb97a
  21. Mar 07, 2023
    • Dominik Laskowski's avatar
      FTL: Add Optional<T>::or_else · 07a71cdb
      Dominik Laskowski authored
      Bug: 185536303
      Test: ftl_test
      Change-Id: Idf0bac4711111c8cb28e8624bb146a76ec1ff38b
      07a71cdb
    • Harry Cutts's avatar
      Support touchpad gesture properties in IDC files · 3ca39d03
      Harry Cutts authored
      Specific touchpads often require small tweaks to the Gestures library's
      gesture properties to work well. Examples of such tweaks include palm
      thresholds, or the parameters to the stationary wiggle filter. To
      support this, allow properties to be set using the 'gestureProp.' prefix
      in IDC files, with the spaces in property names replaced by underscores.
      For example, to set the "Pressure Calibration Offset" property to 30,
      add this line to the relevant IDC file:
      
          gestureProp.Pressure_Calibration_Offset = 30
      
      Only single-valued boolean, integer, or real properties can be set this
      way. There's currently no use case for strings. The only use case for
      arrays is for acceleration curves, which wouldn't work well with this
      system anyway since they'd be overridden by the pointer speed settings.
      
      Bug: 271251605
      Test: atest inputflinger_tests
      Test: connect Apple Magic Trackpad 2, check properties are set correctly
            in dumpsys input
      Change-Id: I1bf97c9753e48c00d3dc3098cb676f7baebc84ce
      3ca39d03
  22. Mar 04, 2023
    • Siarhei Vishniakou's avatar
      Use current directory to load prediction model · fd0a68e3
      Siarhei Vishniakou authored
      Before this CL, the testing binary could not execute properly when
      invoked directly. This is because the current working directory does not
      get set.
      
      To fix this, use the model file from /system/etc when __ANDROID__ is
      defined, and refer to the current directory for all other cases.
      
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      Test: atest libinput_tests
      Test: atest --host libinput_tests
      Bug: 271134652
      Change-Id: I0547ca9666eab153208a581fb60f6bef656b946a
      fd0a68e3
  23. Mar 03, 2023
  24. Mar 02, 2023
    • Siarhei Vishniakou's avatar
      Initialize mLayoutOverlayApplied · 1e5ec0a0
      Siarhei Vishniakou authored
      This variable is left uninitialized. On some platforms, this causes the
      libinput_tests to fail when sanitizers are enabled.
      
      Bug: 251249010
      Test: m libinput_tests && adb sync data && adb shell -t /data/nativetest64/libinput_tests/libinput_tests --gtest_filter="*keyCharacterMapParcelingTest*"
      Change-Id: I05063efdde9a826f7001dca828b84bbec5beb0df
      1e5ec0a0
  25. Feb 24, 2023
    • Alec Mouri's avatar
      Add missing "Introduced in" docs from NDK · 5a100fac
      Alec Mouri authored
      Devs should be able to determine if they can use an api just from
      reading the api docs.
      
      Bug: 270405876
      Test: none
      Change-Id: I62df5447bc547be52f6b00fedf1006c8d66a5faf
      5a100fac
  26. Feb 23, 2023
  27. Feb 22, 2023
    • Siarhei Vishniakou's avatar
      Ensure channel receives a consistent touch stream · 92c8fd5a
      Siarhei Vishniakou authored
      Add an event verifier to check the touch streams that are being sent to
      the input channel.
      
      If a stream is inconsistent, crash.
      
      For now, only touch streams are being verified. Disable the feature
      while the bugs are being fixed.
      
      Bug: 267082966
      Test: m inputflinger_tests && $ANDROID_HOST_OUT/nativetest64/inputflinger_tests/inputflinger_tests
      Merged-In: Ibb8ab70b0019789c1a17dae0077be6b23d3d9139
      Change-Id: Ibb8ab70b0019789c1a17dae0077be6b23d3d9139
      (cherry picked from commit f06b672b)
      92c8fd5a
  28. Feb 21, 2023
    • Zixuan Qu's avatar
      Add virtual input device native classes. · dd0635d5
      Zixuan Qu authored
      Add VirtualInputDevice base class and a set of subclasses for each
      device type. Each virtual input device wraps a fd representing the
      uinput device and a set of write...event() methods.
      
      Most logic are moved from InputController JNI code: see ag/21294055 for
      reference.
      
      Test: atest VirtualInputTest VirtualMouseTest VirtualKeyboardTest
      VirtualTouchscreenTest VirtualDpadTest
      
      Bug: 267515782
      
      Change-Id: Ie3a580acc890ac5af7461f012e05eb9ed3709a5f
      Merged-In: Ie3a580acc890ac5af7461f012e05eb9ed3709a5f
      dd0635d5
  29. Feb 14, 2023
  30. Feb 10, 2023
Loading