Skip to content
Snippets Groups Projects
  1. Apr 24, 2024
    • Harry Cutts's avatar
      input: fix -Wformat warnings · c57cd3c5
      Harry Cutts authored
      These occur when an enum value is formatted as an integer without a
      cast. In all these cases the debug logs are nicer if we use the actual
      name of the enum value, so wrap them all in ftl::enum_string calls.
      
      Bug: 245989146
      Test: Check there are no -Wformat warnings in the output of
            $ m checkinput
      Change-Id: I26333123e9fb445f1640c5e73757ddf4ad2d6e98
      c57cd3c5
  2. Apr 12, 2024
  3. Apr 02, 2024
  4. Mar 30, 2024
    • Derek Wu's avatar
      Add jerk thresholded pruning. · aaa47312
      Derek Wu authored
      This will change MotionPredictor::predict() outputs once
      enable_prediction_pruning_via_jerk_thresholding is enabled.
      
      Test: atest libinput_tests --host with local flag override to enable
      enable_prediction_pruning_via_jerk_thresholding.
      Test: atest CtsInputTestCases
      Test: atest MotionPredictorBenchmark MotionPredictorTest
      Bug: 266747654
      
      Change-Id: I11eb1972246468a1f3824656f5ac57e01e0359cd
      aaa47312
  5. Mar 29, 2024
    • Siarhei Vishniakou's avatar
      Add tracing for InputConsumer lifetime · c0bf3899
      Siarhei Vishniakou authored
      This will help understand when it's created and destroyed. This also helps disambiguate between multiple InputConsumers in the same process.
      
      Test procedure:
      1. Add "system tracing" to quick settings from developer options (enable
         the quick settings tile for system tracing)
      2. Start system tracing via UI of quick settings
      3. Open all apps and do some swipes
      4. Click "stop tracing"
      5. Pull the logs to the device `adb pull /data/local/traces/ ~/trace`
      6. Go to https://ui.perfetto.dev/
      7. Click "open trace file" and navigate to the local file
      8. In the trace, open the process of interest. In this case, it's the
         launcher process
      9. Scroll down to "InputConsumer processing"
      10. The "cookie" field of each entry is the sequence number of this
          event (but not the event id).
      
      Bug: 311142655
      Test: perfetto test procedure described above
      
      Change-Id: If8cdadd3604e8e3ab24c45a5ccf4ea9ffa9fee4a
      c0bf3899
  6. Mar 27, 2024
  7. Mar 26, 2024
    • Yuichiro Hanada's avatar
      Move PointerIconType to AIDL · 56afd1e2
      Yuichiro Hanada authored
      to be shared between Java and C++.
      The values of PointerIconStyle in Input.h and the constants in
      PointerIcon.java are manually synced now.
      This change introduces an AIDL file which can be used by both.
      
      Bug: 235023317, 330827347
      Test: presubmit
      Change-Id: I01f31868e7c13270047673d97035783deaf0a7f6
      56afd1e2
  8. Mar 21, 2024
    • Linnan Li's avatar
      Add owner for include/android/keycodes.h · 04cb6b2e
      Linnan Li authored
      Because of the existence of extra spaces, the owner of keycodes.h is
      not configured as expected. We should delete this extra spaces.
      
      Bug: none
      Test: After merging, check whether the owner of keycodes.h includes
      all users under INPUT_OWNER
      
      Change-Id: I634c49f53a4633bdee3cdefbf0debae4dff90a47
      04cb6b2e
  9. Mar 20, 2024
  10. Mar 15, 2024
    • Chavi Weingarten's avatar
      Add surface_control_input_receiver native API · 99280991
      Chavi Weingarten authored
      Bug: 324271765
      Test: ASurfaceControlInputReceiverTest
      Change-Id: I19a1c796c1d22e8b247368df07c34c1b4b195e64
      99280991
    • Siarhei Vishniakou's avatar
      Send events wrapped in unique_ptr to InputConsumerCallbacks · 3891ec97
      Siarhei Vishniakou authored
      This will allow the upper layers to release the ownership and hand the
      object over to the ndk client. The client will then assume the
      ownership. This is not possible with the current implementation of
      rvalue, because the ndk interface is only using pointers.
      
      Unfortunately, this makes things more clunky for tests (unless we modify
      BlockingQueue).
      
      Bug: 324271765
      Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_repeat=100 --gtest_break_on_failure
      Change-Id: I0cf326a22f840be6f8aa00d1e69f818815788487
      3891ec97
    • Siarhei Vishniakou's avatar
      Add InputConsumerNoResampling, which is a rewrite of InputConsumer · 2b920275
      Siarhei Vishniakou authored
      In this CL, an InputConsumer with built-in looper handling is being
      added. This will be useful for native code that needs batching, and that
      provides choreographer callbacks directly into native code.
      
      Before this CL (and with this CL, temporarily) the InputConsumer logic
      was split between native and jni layers. In general, we shouldn't have
      logic inside jni. But in this case, the situation was also making the
      code difficult to reason and debug.
      
      In this new InputConsumerNoResampling class, all of the features of
      InputConsumer and NativeInputReceiver are combined, except for
      resampling. That will be done separately, at a later time.
      
      As a result, we will not be switching to the new
      InputConsumerNoResampling class right away.
      
      Once resampling is added, we can switch to the new
      InputConsumerNoResampling (and rename it to InputConsumer), and delete
      the old InputConsumer.
      
      In the meantime, the new InputConsumerNoResampling will be useful in the
      new NDK APIs. There, having resampling is not critical.
      
      Bug: 311142655
      Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_repeat=100 --gtest_break_on_failure
      Change-Id: I468ddbd8406c4bf9f5e022f79fd1a582ba680633
      2b920275
  11. Mar 14, 2024
  12. Mar 13, 2024
    • Siarhei Vishniakou's avatar
      Move InputConsumer into separate files · 0438ca8a
      Siarhei Vishniakou authored
      This helps to keep track of things, and it also allows easier deletion
      in the future.
      
      Bug: 311142655
      Test: none
      Change-Id: Iece2bf6857ab05f86072031a4cf3a36f843b1634
      0438ca8a
    • Chavi Weingarten's avatar
      Add native InputTransferToken · a6f572f9
      Chavi Weingarten authored
      Added a native class that corresponds to the Java InputTransferToken.
      
      Test: SurfaceControlInputReceiverTests
      Test: AInputTransferTokenTest
      Bug: 324271765
      Change-Id: Ida2a7b34338560dfed9af7f510d64372e41384af
      a6f572f9
    • Hiroki Sato's avatar
      Use input token in PointerCaptureRequest · 25040239
      Hiroki Sato authored
      Instead of sending boolean to indicate the capture state,
      InputDispatcher now sends an input window token that requests a
      pointer capture, or nullptr otherwise.
      
      This is useful for some InputReader implementations.
      Also, this token can be used to verify if a pointer capture changed
      event from a reader is valid.
      
      Bug: 259346762
      Bug: 301628662
      Test: inputflinger_tests
      Test: android.view.cts.PointerCaptureTest WindowFocusTests#testPointerCapture
      Change-Id: Ie8343db6744dc2080f7f1dcff5a630be5c87fa3e
      25040239
  13. Mar 11, 2024
    • Siarhei Vishniakou's avatar
      Move BlockingQueue.h to libinput · 3782af62
      Siarhei Vishniakou authored
      This is already useful in several places, and it's going to be also
      useful in the future when InputConsumer is refactored.
      
      So let's move it to include/input.
      
      Bug: 311142655
      Test: m inputflinger_blocking_queue_fuzzer
      Change-Id: Idfc492c6bfc3cccab7e0b0d12b21a41a954cc44b
      3782af62
  14. Mar 07, 2024
    • Siarhei Vishniakou's avatar
      Move static functions to InputConsumer cpp file · 9dbf6375
      Siarhei Vishniakou authored
      This way, they can be reused by other code in that file. For example,
      by the new "InputConsumerNoResampling".
      
      Also, pass the parameters by ref because they are not nullable.
      
      Bug: 311142655
      Test: m libinput libinput_tests
      Change-Id: Ib40bcddfcb3d49b0a42d58533dcc566d9d49a500
      9dbf6375
  15. Mar 06, 2024
  16. Mar 05, 2024
    • Prabir Pradhan's avatar
      MotionEvent: Get offsets in raw coordinate space · add8a4a9
      Prabir Pradhan authored
      MotionEvents store the underlying axis values in the coordinate space of
      the physical display, or "untransformed" space. The MotionEvent's
      mRawTransform takes those coordinates into the coordinate space of the
      logical display, or "raw" coordinates. The MotionEvent's mTransform
      takes those coordinates into the window/View's local coordinates.
      
      Previously, getting the motion event offset would return the offset with
      respect to the origin of the "untransformed" space. This is of little
      value to callers, since they are expecting the offset in "raw"
      coordinates, which is the offset with respect to the logical display's
      origin.
      
      To calculate the raw offset, we calculate where the raw point (0, 0)
      would map to in untransformed coordinates by applying the inverse raw
      transform, and then apply the window transform.
      
      Bug: 249340921
      Test: atest libinput_tests
      Test: atest inputflinger_tests
      Change-Id: Iadbdde4dd45b5527b73be863b198b4c9a9e713cc
      add8a4a9
    • Prabir Pradhan's avatar
      Move MotionEvent#split implementation to native · bf9b0a85
      Prabir Pradhan authored
      There is already a native implementation of split in InputDispatcher.
      Prevent code duplication by moving the Java impl to native. The Java
      impl is not correct, because it cannot access all values like the
      transforms to initialize the split event with.
      
      Bug: 326171104
      Test: atest libinput_tests
      Test: atest inputflinger_tests
      Change-Id: I6230b6aa0696dcfc275a5a14ab4af3d4b7bd0b45
      bf9b0a85
  17. Mar 04, 2024
    • Matt Buckley's avatar
      Update PowerHAL wrapper support checking behavior · 6c18e6da
      Matt Buckley authored
      - Updates support checks to check status for UNKNOWN_TRANSACTION
      - Adds PowerHintSessionWrapper class to check support on session methods
      - Ensures that wrapper methods check the HAL version number for support
      - Adds macros to cache returned wrapper call support status
      
      Bug: 324255931
      Test: atest libpowermanager_test
      Test: atest libsurfaceflinger_unittest:PowerAdvisorTest
      Change-Id: I4b329e6b55c53198bb064a34e792be6336e66e27
      6c18e6da
  18. Feb 28, 2024
  19. Feb 23, 2024
  20. Feb 20, 2024
  21. Feb 16, 2024
  22. Feb 15, 2024
    • Alec Mouri's avatar
      Add support for restricting HDR headroom for video · 1b0d4e16
      Alec Mouri authored
      This is needed for allowing apps to vote for HDR headroom restrictions
      for SurfaceView and SurfaceControl
      
      Bug: 323964760
      Test: manually poking at test app
      Test: SurfaceViewTests
      Test: SurfaceControlTest
      Test: ASurfaceControlTest
      Change-Id: Ie886e67879525462d49fdedc535aea659d69321a
      1b0d4e16
  23. Feb 14, 2024
  24. Feb 05, 2024
    • Siarhei Vishniakou's avatar
      Pass unique_ptr of InputChannel to Connection · 7b9f4f53
      Siarhei Vishniakou authored
      This gets us closer to the goal of storing unique_ptr of InputChannel
      inside the InputPublisher.
      
      In this CL, we are still allowing the "copy" and "dup" functions to
      exist. Removing those requires significant refactoring on the Java side,
      including the jni layer and object ownership models.
      
      Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
      Bug: 161009324
      Change-Id: If6f44d78c7fc9f3e12729068de1753847abf0ebb
      7b9f4f53
  25. Feb 01, 2024
    • Yeabkal Wubshit's avatar
      Support for InputDevice ViewBehavior · b1b96db1
      Yeabkal Wubshit authored
      This change creates a struct within InputDeviceInfo to hold View related
      behaviors of an input device. Currently, a single behavior is supported:
      device.viewBehavior_smoothScroll. This can be specified in an IDC file
      to hint clients of the InputDevice that they should animate scrolls for
      motion events generated by the InputDevice.
      
      Bug: 246946631
      Test: add property in IDC, check API returns expected value
      Test: atest frameworks/native/services/inputflinger/tests/InputReader_test.cpp
      Change-Id: Ibe373cadc40d2a08116e787b744dd30812638edb
      b1b96db1
    • Siarhei Vishniakou's avatar
      Store Connection in InputTarget and Monitor · 18cbdb8e
      Siarhei Vishniakou authored
      This will replace the InputChannel. They don't both need to be shared
      pointers. A lot of times, we are using InputChannel to look up the
      connection. In this CL, this is simplified by using the connection
      directly.
      
      Bug: 161009324
      Test: atest inputflinger_tests
      Change-Id: I3fc2bbdd8c5076b5dbff5067e4fec6e45f5c3da6
      18cbdb8e
    • Matt Buckley's avatar
      Allow ADPF WorkDuration CPU duration to be zero · 0bbd177f
      Matt Buckley authored
      This patch updates the checks, tests, and documentation to ensure ADPF
      CPU == 0 is allowed, and instead checks to make sure that both CPU
      and GPU cannot be 0 at the same time.
      
      Bug: 323226967
      Test: atest PerformanceHintManagerTest
      Change-Id: I6927899793c7d9801541465280af32627e200dc9
      0bbd177f
  26. Jan 30, 2024
    • Siarhei Vishniakou's avatar
      Use aidl-defined InputChannel for parceling · 8d66013c
      Siarhei Vishniakou authored
      Currently, InputChannel is a manually-written parcelable. In this CL, we
      introduce an aidl-defined InputChannel, which eventually could also be
      used in Java as well.
      
      Now, whenever an InputChannel needs to be written to parcel, we first
      create the new android.os.InputChannel and then write that object to
      parcel.
      
      Eventually, we can convert the Java side of InputChannel to use this
      mechanism, as well.
      
      Bug: 161009324
      Test: adb shell monkey 1000
      Test: atest libgui_test
      Change-Id: Ib44c5ff02b3c77e0425b59a76195ed100e187317
      8d66013c
    • Dominik Laskowski's avatar
      FTL: Add Expected<T, E> · 9bb429aa
      Dominik Laskowski authored
      Extend `base::expected` with `has_error()` and `value_opt()`.
      
      Bug: 185536303
      Test: ftl_test
      Change-Id: I07d70dc8fe7ebfe2f08626dff51aef0b98430f61
      9bb429aa
    • Vaibhav Devmurari's avatar
      Add native side keycodes for emoji and screenshot · f14b37a8
      Vaibhav Devmurari authored
      Bug: 315307777
      Test: manual
      Change-Id: I737a7418f43afac4735bb1a5523713890f4df553
      f14b37a8
  27. Jan 29, 2024
  28. Jan 26, 2024
    • Alec Mouri's avatar
      Correctly pass screenshot fences to transaction callbacks · 9892aac6
      Alec Mouri authored
      In some instances, a screenshot may be captured before a layer has a
      release callback registered. This can happen when a new buffer has
      not yet been transacted before a screenshot is captured. This causes the
      screenshot fence to be dropped and the possibility of tearing when
      capturing a screenshot while continuously rendering.
      
      To resolve this, buffer screenshot fences into a list of future fences
      when there is no callback registered, and merge those fences when
      dispatching the release callback.
      
      Bug: 302703346
      Test: SurfaceViewTests#testMovingWhiteSurfaceView 100 times
      Change-Id: I91aec3cdb0973092d48cd77e59dd3999e9d9e847
      9892aac6
  29. Jan 25, 2024
Loading