Skip to content
Snippets Groups Projects
  1. Feb 10, 2023
    • Philip Quinn's avatar
      Use mmap to read TFLite model. · cb3229aa
      Philip Quinn authored
      The buffers in the model file are used directly by TFLite, and so a
      small memory saving can be achieved by backing those memory pages with
      the file itself.
      
      Bug: 267050081
      Test: atest libinput_tests
      Change-Id: I743a3c94477d4bb778b6e0c4b4890a44f4e19aa4
      cb3229aa
    • Philip Quinn's avatar
      Replace shared libtflite dependency with static library. · da6a448e
      Philip Quinn authored
      This allows us to only include the ops required to run the model and
      have the linker strip the rest out, reducing memory overhead.
      
      Bug: 267050081
      Test: atest libinput_tests
      Change-Id: I4055a0c8971ed4308ccfa425ab5e5ba560deb58c
      da6a448e
  2. Feb 06, 2023
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
    • Siarhei Vishniakou's avatar
      Use std::optional for active pointer id · 657a1732
      Siarhei Vishniakou authored
      The active pointer id is not always valid. Rather than using a magic
      value for it (-1), let's use std::optional.
      
      Some other fixes:
      - convert to enum class, for better type safety / switch checking
      - ident switch statements
      
      It's necessary to ident switch statements to avoid weird clang-format
      problems when changing code that follows those sections.
      
      Bug: 167946721
      Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
      Change-Id: I6b78301e2c1d2fba1a789fa9491f7d6ab8b37d02
      657a1732
  13. Jan 10, 2023
  14. Jan 09, 2023
    • Harry Cutts's avatar
      Report pinch gestures · b1e8355b
      Harry Cutts authored
      Bug: 251196347
      Test: check events received by a custom tester app, and touches shown by
            pointer location overlay
      Test: atest inputflinger_tests
      Change-Id: I249ca6208091e3c4291c5be68c77339bf5f69a5b
      b1e8355b
    • Harry Cutts's avatar
      Report two-finger touchpad swipes · ef400b26
      Harry Cutts authored
      Bug: 251196347
      Test: try out two-finger scroll gestures with an Apple Magic Trackpad 2
      Test: atest inputflinger_tests
      Change-Id: I9e693350873b90bd50605ab348821224ae1121a8
      ef400b26
  15. Jan 06, 2023
    • Philip Quinn's avatar
      Add isResampled field to PointerCoords. · afb31288
      Philip Quinn authored
      This field is set if a pointer's coordinate data were generated by
      input resampling and did not originate from the input device.
      
      Bug: 167946721
      Test: atest libinput_tests
      Change-Id: I30d9aee85d462e6536fa33be5242365b52a11a6c
      afb31288
    • Siarhei Vishniakou's avatar
      Provide prediction time from the application · 0839bd63
      Siarhei Vishniakou authored
      After further discussion with the graphics team, it turns out that the
      Choreographer isn't the best way to compute the prediction time.
      
      There may be some strategy that would use the Choreographer, like
      looking at the last vsync and trying to guess when the next drawing will
      occur.
      
      However, for now, let's just provide this time from the application and
      experiment with it. If we do need the Choreographer, we should be able
      to get this data from libgui here in the native layer, so we don't need
      the java to set this time, anyways.
      
      Bug: 167946763
      Test: atest libinput_tests inputflinger_tests
      Change-Id: I496a9c184745d4cec085b880f913983cc2be9e3f
      0839bd63
  16. Jan 04, 2023
    • Harry Cutts's avatar
      Report three- and four-finger swipes · c5748d19
      Harry Cutts authored
      The dispatcher still needs to be modified to only dispatch these to
      SysUI windows.
      
      Bug: 251196347
      Test: check events received by a custom tester app, and touches shown by
            pointer location overlay
      Test: atest inputflinger_tests
      Change-Id: I3a7211d4a67e6388231bef158d3748c2e72e128d
      c5748d19
    • Vaibhav Devmurari's avatar
      Convert country code to Layoutinfo (Language tag + Layout type) · 7fb41136
      Vaibhav Devmurari authored
      Instead of passing country code to InputDevice.java, convert it
      to Language tag and Layout type on native side and pass that
      forward instead.
      We can later add support for  HID language tag, that would give
      us better layout information than country code. This HID
      language tag is for Keyboard devices so, we set this country
      code derived language tag also for Keyboards only, even though
      country code could be specified for all types of devices.
      Moreover, we are using language tag and layout type for setting
      layout related info for Virtual keyboard devices too, making
      using country code redundant.
      
      Test: atest inputflinger_tests
      Bug: 259530132
      Change-Id: I8eca5537a5bb44d0b8b056947cc317ac82a0901f
      7fb41136
  17. Dec 22, 2022
    • Siarhei Vishniakou's avatar
      Add native MotionPredictor · 39147cee
      Siarhei Vishniakou authored
      The native MotionPredictor will call neural net code to create motion
      predictions for the provided gesture stream.
      
      In this CL, a simple linear extrapolation model is provided in order to
      test the API.
      
      To enable prediction:
      adb shell setprop persist.input.enable_motion_prediction true
      
      Bug: 167946763
      Test: atest InputTests inputflinger_tests libinput_tests
      Change-Id: Id8a23b728aeb844288d5b8daae0829d61d4c1482
      39147cee
  18. Dec 21, 2022
  19. Dec 17, 2022
  20. Dec 16, 2022
    • Prabir Pradhan's avatar
      TouchInputMapper: Use ui::Transform to calculate orientation angles · e2e10b4a
      Prabir Pradhan authored
      Rather than manually re-orienting the calculated angles for orientation
      and tilt, we use the transform to compute the oriented values for these
      non-planar axes. This approach is both less error-prone and less verbose.
      
      In this CL, we also transform the coverage rect from raw to display
      space using the computed transform.
      
      Bug: 236798672
      Test: atest inputflinger_tests
      Change-Id: Ibfb6d2ab43e6fd7a63736ee7d9610c42be44affd
      e2e10b4a
    • Zixuan Qu's avatar
      Gets keyboard layout info from user space when available. · fecb6064
      Zixuan Qu authored
      The layout info consists of a BCP 47 conformant language tag and a
      layout type such as "qwerty" or "azerty". They will be used to
      initialize the input device.
      
      This is currently used by uinput virtual keyboard to pass in layout
      information.
      
      Bug: 237537306
      Test: atest inputflinger_tests
      Change-Id: Icfc30f1afb0f88dd704d1d598d62a300a032b0f5
      fecb6064
  21. Dec 14, 2022
    • Vaibhav Devmurari's avatar
      Sync native definitions of java key codes · ba9d2022
      Vaibhav Devmurari authored
      This is a partial cherry-pick of
      cf875ab2
      
      Bug: 262287992
      Change-Id: I40c0b6f7d0e67ffc1ee01c6cb1dfbcfc96b37d62
      Merged-In: I40c0b6f7d0e67ffc1ee01c6cb1dfbcfc96b37d62
      ba9d2022
    • Matt Buckley's avatar
      Make sendHint private in platform · cd7f6eb1
      Matt Buckley authored
       * Convert PerformanceHintManager sendHint to a private API
       * Have HWUI depend on private implementation
      
      Bug: b/261640114
      Test: atest PerformanceHintNativeTestCases
      Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
      
      Change-Id: I9d13f1eaff856dc3d38de5f6c1b5cf92a75f6ec3
      cd7f6eb1
  22. Dec 07, 2022
    • Sam Dubey's avatar
      Revert "Track hovering pointers explicitly" · 39d37cfb
      Sam Dubey authored
      Revert "Remove duplicate ACTION_HOVER_MOVE"
      
      Revert submission 20414906-refactor hovering pointers
      
      Reason for revert: Part of DM+Platinum monitor efforts likely Likely causing b/261731836. This won't be submitted if proven otherwise.
      
      Reverted Changes:
      I3665d8e68:Remove duplicate ACTION_HOVER_MOVE
      I047926e53:Track hovering pointers explicitly
      
      Change-Id: I64b682558071661d79dca953d449251f79ee7004
      39d37cfb
    • Siarhei Vishniakou's avatar
      Track hovering pointers explicitly · d57302f9
      Siarhei Vishniakou authored
      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.
      
      Bug: 211379801
      Test: m inputflinger_tests && adb sync data && adb shell -t /data/nativetest64/inputflinger_tests/inputflinger_tests
      Change-Id: I047926e53b846c96807aed45fb585e031e5b88b9
      d57302f9
  23. Dec 06, 2022
  24. Dec 02, 2022
    • Leon Scroggins III's avatar
      Prevent calling new ftl::Optional · b19461b1
      Leon Scroggins III authored
      This class inherits from std::optional, which does not have a virtual
      destructor. As such, deleting an object of ftl::Optional using a pointer
      to its base class has undefined behavior. Prevent this by removing new
      from ftl::Optional. This is generally not the right way to use it
      anyway, and in fact this builds as is.
      
      Delete new[] while we're at it. This should be enough of a signal not to
      try to heap allocate these. It's still possible for a programmer to
      circumvent these deletions, but they prevent the straightforward
      (broken) use case.
      
      Bug: 261035092
      Test: make
      Change-Id: Iafdaf98ed88920162af2b445caf0e4a69be51ab5
      b19461b1
    • Michael Wright's avatar
      Convert MotionEvent#getSurfaceRotation to ui::Rotation · 635422be
      Michael Wright authored
      Because it might have an invalid rotation it needs to return
      std::optional<ui::Rotation>, but at least we're using the types
      effectively here.
      
      Test: compiles
      Change-Id: I27076edcc6ce33594552863caa8ee643027a81e7
      635422be
    • Michael Wright's avatar
      Convert orientation values in input to ui::Rotation. · a9cf419c
      Michael Wright authored
      ui::Rotation both provides better typesafety as well as some convenience
      functions (e.g. operator+, operator-).
      
      Test: atest TouchVideoFrame_test.cpp InputReader_test.cpp
      Change-Id: Ib423457c742ed3d41f2e3fc269ddf86809cbf247
      a9cf419c
  25. Nov 29, 2022
  26. Nov 22, 2022
Loading