Skip to content
Snippets Groups Projects
  1. Apr 13, 2023
  2. 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
  3. 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
  4. Mar 28, 2023
  5. Mar 16, 2023
  6. 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
  7. Mar 13, 2023
  8. 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
  9. 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
  10. 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
  11. Mar 03, 2023
  12. 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
  13. 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
  14. Feb 23, 2023
  15. 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
  16. 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
  17. Feb 14, 2023
  18. Feb 10, 2023
  19. Feb 07, 2023
    • Matt Buckley's avatar
      Revert "Use "SessionHint" enum in ndk API" · 63a0fd19
      Matt Buckley authored
      Revert submission 21161765-sessionhint_api
      
      Reason for revert: this broke the main-finalization-1 build... somehow. see b/268111957
      
      Reverted changes: /q/submissionid:21161765-sessionhint_api
      
      Change-Id: I2a8b6609729bba06fc9409f4583886915c82577c
      63a0fd19
  20. Feb 06, 2023
  21. Feb 02, 2023
    • Seunghwan Choi's avatar
      Separate default pointer for mouse and stylus (native part) · 75789cd7
      Seunghwan Choi authored
      Let PointerController (MouseCursorController) know the source of
      the current event, either mouse or stylus.
      MouseCursorController will show the proper default pointer for
      the active source, if the requested pointer type is TYPE_NOT_SPECIFIED.
      
      Test: Manual Test
      Bug: b/215436642
      Change-Id: I91f702db661846fc7ad857f71656903c8aa4334a
      75789cd7
  22. Feb 01, 2023
    • Rachel Lee's avatar
      Attached Choreographer API from SurfaceControl. · c0d38fcb
      Rachel Lee authored
      The API to get a native attached choreographer from
      ASurfaceControl.
      
      Bug: 255838011
      Test: atest GraphicsTest
      Test: atest ChoreographerNativeTest (test no regression)
      Change-Id: I5db99d8888fd2adbc4a8fc2ce9a7c07f4de146ee
      c0d38fcb
  23. Jan 31, 2023
    • Matt Buckley's avatar
      Use "SessionHint" enum in ndk API · f7b49138
      Matt Buckley authored
      Change NDK to use "SessionHint" enum consistently across definitions.
      
      Bug: 266596626
      Test: manual
      Change-Id: I6ad095655b2dc05daf95cb5e7f506b3725915596
      f7b49138
  24. Jan 26, 2023
    • Philip Quinn's avatar
      Add TFLite model for motion prediction. · 8f953ab5
      Philip Quinn authored
      This model generates probabilistic motion predictions based on a
      sequence of relative input movements. The input movements are converted
      into polar coordinates (distance and angle) based on an axis that
      follows the current path. This ensures that the orientation of the
      device and of the inputs do not affect the predictions. The orientation
      of the input device is also transformed to be relative to the path axis.
      
      The test cases verifying model efficacy are consolidated into CTS.
      
      Bug: 167946763
      Test: atest libinput_tests
      PiperOrigin-RevId: 492068340
      Change-Id: Icd8d90bd5a7ce79c699bfdb6367a4cbd8130441a
      8f953ab5
    • Peiyong Lin's avatar
      Use pid_t instead of not int32_t. · c1041d4f
      Peiyong Lin authored
      Bug: b/266595015
      Test: atest PerformanceHintManagerTest
      Change-Id: I33755bb30cceb9953db293092e417a1a14288226
      c1041d4f
  25. Jan 24, 2023
    • Siarhei Vishniakou's avatar
      Validate axes and led labels correctly · 5df3493d
      Siarhei Vishniakou authored
      Before this CL, a number of checks for kl file validity were incorrect.
      Some of the APIs were supposed to return an invalid value, but instead
      were always returning a valid value, no matter what the input was.
      
      Correct these values by switching to std::optional.
      
      Bug: 266400536
      Test: m libinput_tests && adb sync data && adb shell -t /data/nativetest64/libinput_tests/libinput_tests
      Change-Id: I4ef45f3249dca4f4f033fb85e9fecbc2ad1f1395
      5df3493d
  26. Jan 23, 2023
    • Siarhei Vishniakou's avatar
      Improve debug prints in InputDispatcher · d010b014
      Siarhei Vishniakou authored
      It's useful sometimes to print out the events produced by the
      dispatcher. In this CL:
      - Switch (partially) to the C++-style prints from android-base
      - Add a way to print keyevents, motionevent into a stream
      - Add InputEventInjectionResult print
      
      Also, improve the debug prints for outgoing events. When an entry is
      getting dispatched, the dispatcher may modify its action, among other
      variables. With this CL, this will be observable in the logs.
      
      Bug: 211379801
      Test: atest AccessibilityEndToEndTest
      Change-Id: I221161af7903ae4da77733265c67a426a3e5b557
      d010b014
  27. Jan 20, 2023
    • Harry Cutts's avatar
      TouchpadInputMapper: add dump method · ea73eaa7
      Harry Cutts authored
      This dumps the state from the gesture converter, and a list of gesture
      properties, which is useful for debugging settings.
      
      Bug: 251196347
      Test: run dumpsys input with touchpad connected, check output
      Change-Id: I036d0251b06489b645b883a239ff345a98448497
      ea73eaa7
  28. Jan 19, 2023
    • Siarhei Vishniakou's avatar
      Track hovering pointers explicitly -- try 2 · b581f7f0
      Siarhei Vishniakou authored
      Update:
      Compared to the first version of this CL that got reverted, this version
      also adds Flags::FOREGROUND to the windows whenever appropriate.
      
      Before this CL, hovering window was tracked separately inside
      InputDispatcher. This window was getting updated in various places.
      Inconsistent motion streams, like HOVER_ENTER->DOWN->UP->HOVER_EXIT were
      possible.
      
      In this CL, we track hovering pointers inside TouchedWindow. At all
      times, the currently tracked pointer must always be in the touch state.
      The hovering pointer is removed when HOVER_EXIT is received.
      
      This CL also establishes the foundation for multi-device, multi-pointer
      streams, by storing hovering pointers inside TouchedWindow per-device.
      
      Eventually, we can look into separately creating touched targets from
      updating the touch state. This approach is partially used in this CL.
      
      TouchState is used to keep track of where the hovering pointer is
      currently. The 'addHoveringWindowsLocked' function returns the
      equivalent of InputTargets. Eventually, we can change this to return
      InputTargets.
      
      39d37cfb
      
      Bug: 211379801
      Test: atest android.accessibilityservice.cts.AccessibilityEndToEndTest
      Test: atest VirtualMouseTest
      Test: m inputflinger_tests && adb sync data && adb shell -t /data/nativetest64/inputflinger_tests/inputflinger_tests
      
      Change-Id: I0aa77bc9f680786b154312c4c936da2cf6efffa1
      b581f7f0
  29. Jan 17, 2023
    • Prabir Pradhan's avatar
      Add an API to get the supported USI version for a display · e04ffaaa
      Prabir Pradhan authored
      The InputManager#getHostUsiVersion(displayId) API can be used to tell if
      a display supports the Universal Stylus Initiative protocol for styluses,
      and can be used to address version compatibility issues.
      
      We first dynamically attempt to find an InputDevice associated with the
      display that supports USI. If there are none, we check the statically
      add USI version for the display in config_displayUsiVersionArray.
      Checking the config as a fallback means the USI InputDevice does not
      have be registered/open perpetually for the getHostUsiVersion() API to
      return the correct values.
      
      Bug: 261596890
      Test: manual with device
      Test: atest TouchScreenTest
      Change-Id: Ifabd00aa996ba88258d8112e5de3582adaf27629
      e04ffaaa
  30. Jan 13, 2023
    • Seunghwan Choi's avatar
      [scribe] Add index of handwriting icon on native · 92d7fd07
      Seunghwan Choi authored
      Add TYPE_HANDWRITING index on native input.h to use on
      inputManagerService.cpp
      
      Test: Manual Test(hover pointer on handwriting area)
      Bug: b/215436642
      Change-Id: I41caec44d81c414b4acc1e3575c5acc6f99146d8
      92d7fd07
    • Siarhei Vishniakou's avatar
      Per-pointer processing in VelocityTracker · 8d23203e
      Siarhei Vishniakou authored
      We would like to skip resampled data in VelocityTracker when the
      velocity is being computed. To make this happen, we need to first
      process the data per-pointer. This will then allow us to skip individual
      data points.
      
      To minimize the impact to older VT strategies that are largely untested,
      the main change here is to make 'mMovements' and 'mIndex' become
      per-pointer, rather than converting to a vector.
      
      Also, use std::array instead of [] because [] cannot be used inside a
      std::map easily.
      
      There should be no functional change in this CL. The actual skipping of
      resampled values will be done in a separate CL.
      
      Bug: 167946721
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      
      Change-Id: I1c3c845bca0d4bb7d2c3973bfe84462139ac36f3
      8d23203e
  31. Jan 12, 2023
    • Vaibhav Devmurari's avatar
      Clear applied layout overlay if new layout overlay is null. · 23e8ae9c
      Vaibhav Devmurari authored
      Need to allow resetting of key character map by setting overlay
      map to null. This is required when moving from a IME setting
      that has a KCM to another IME setting that has none.
      
      Test: atest KeyboardLayoutChangeTest
      Bug: 20805588
      Change-Id: I62dc65970b61628486aff698a8ab8ccb31c109d6
      23e8ae9c
Loading