Skip to content
Snippets Groups Projects
  1. Sep 12, 2022
    • Prabir Pradhan's avatar
    • Prabir Pradhan's avatar
      Resolve associated display and pointer display in CursorInputMapper · c04d04de
      Prabir Pradhan authored
      An InputDevice can be associated with a display, in which case it should
      only generate events for that display. A mouse generally generates
      events for whichever display is currently showing the mouse cursor.
      
      In the case where a mouse InputDevice is associated with a display, we
      need to make sure that it only generates events when the mouse cursor is
      on the associated display.
      
      Additionally, any display-dependent configuration, such as orientation,
      should depend on whichever display the device is configured for.
      
      Bug: 236075874
      Test: atest inputflinger_tests
      Change-Id: I1021c121c1eae768585124d312f5187be90da666
      Merged-In: I1021c121c1eae768585124d312f5187be90da666
      (cherry picked from commit c13ff081)
      c04d04de
  2. Sep 09, 2022
    • Rachel Lee's avatar
      Fix getLatestVsyncEventData deadline. · 4bce2e19
      Rachel Lee authored
      Bug: 239775097
      Test: atest libsurfaceflinger_unittest
      Test: pixel 4xl camera preview test (see bug)
      Change-Id: Ib92849291458f59c2ef2238d3586211b87174c7f
      (cherry picked from commit 0679cf20)
      Merged-In: Ib92849291458f59c2ef2238d3586211b87174c7f
      4bce2e19
  3. Sep 01, 2022
    • Prabir Pradhan's avatar
      Merge changes I111361f7,Ic4979b91,Ic289d772 into tm-qpr-dev · 7fa3483d
      Prabir Pradhan authored
      * changes:
        Reset the touch state when the active viewport is disabled
        Fix issues with InputMapper tests
        Fix spot not disappear when display id changed
      7fa3483d
    • Prabir Pradhan's avatar
      Reset the touch state when the active viewport is disabled · f670dad1
      Prabir Pradhan authored
      When an active viewport becomes inactive, cancel any ongoing gestures
      immediately. When the viewport becomes active again, make sure state is
      reset again so that we eliminate any race conditions between the
      viewport becoming active and first touches coming in from the device.
      
      This is a preventative measure to defend against unexpected touch
      behavior around viewports being activated and deactivated.
      
      Bug: 234662773
      Test: atest inputflinger_tests
      Change-Id: I111361f7470fdad39b493b516e8a8f167e0c681c
      Merged-In: I111361f7470fdad39b493b516e8a8f167e0c681c
      (cherry picked from commit c0bdeefd)
      f670dad1
    • Prabir Pradhan's avatar
      Fix issues with InputMapper tests · 36690419
      Prabir Pradhan authored
      - When an input device is added, a device reset notification is sent.
        This should be consumed when the device is added so that it does
        not need to be consumed in every test case.
      - The above change exposed an issue with a CursorInputMapper test case,
        where it was consuming the wrong device reset notification.
      - When a device is configured, it may produce device reset
        notifications. After configuring, we should loop the input reader so
        that the queued input listener is flushed so that these args can be
        sent out.
      
      Bug: 234662773
      Test: atest inputflinger_tests
      Change-Id: Ic4979b91207a6abf4c4ac65fd3db30307cb53729
      Merged-In: Ic4979b91207a6abf4c4ac65fd3db30307cb53729
      (cherry picked from commit b5174de1)
      36690419
  4. Aug 31, 2022
  5. Aug 27, 2022
    • Brian Duddie's avatar
      Fix double-close on direct channel registration · 83dde25b
      Brian Duddie authored
      In the AIDL sensor HAL wrapper, file descriptors associated with a
      direct channel were being wrapped in the AIDL NativeHandle type using
      makeToAidl(), which ends up taking ownership of the fds, and
      unintentionally closing them when the object goes out of scope (via
      ndk::ScopedFileDescriptor), so the same fds would be closed at a later
      point when the original native_handle_t is closed.
      
      Switch to dupToAidl() which does not take ownership of the input file
      handles.
      
      Bug: 234456046
      Test: apply fdsan protection (in different CL), confirm via
            test-sensorservice that the file descriptor is not closed twice
      Change-Id: I51c0ba0f31b43c56bf055d186a599b289ca0065f
      83dde25b
  6. Aug 25, 2022
    • Ady Abraham's avatar
      SF: fix refresh rate scoring when frameRateMultipleThreshold is used · fad66b2c
      Ady Abraham authored
      We can't exclude layers that are below the frameRateMultipleThreshold
      when scoring the higher refresh rates (the ones above the threshold)
      as it creates gives the lower refresh rates a higher score (as there are
      more layers that are allowed to score them). Instead we use a different
      approach which first scores the refresh rates based on all the layers
      but the fixed source ones, and then we add the fixed source ones for the
      refresh rates below the thresholds and for the above ones only when other
      layers already scored them.
      
      Bug: 242283390
      Test: newly added unit tests scenarios
      
      SF: layers above the frameRateMultipleThreshold should always be counted
      
      An additional fix on top of ae2e3c74
      which also include layers that have a desired refresh
      rate that was calculated hueristically and matches the max refresh rate.
      
      Bug: 242283390
      Test: newly added unit tests scenarios
      
      Change-Id: I85534a3e004f372349dbf923ee6013855a54e4fa
      Merged-In: Ibe30ddd306265507ceedff6a6a725dadadc50af2
      Merged-In: I85534a3e004f372349dbf923ee6013855a54e4fa
      fad66b2c
  7. Aug 24, 2022
  8. Aug 23, 2022
  9. Aug 19, 2022
    • Matt Buckley's avatar
      Add additional tests for PowerAdvisor · 57274054
      Matt Buckley authored
      Adds additional tests for PowerAdvisor functionality regarding
      timing and multidisplay
      
      Bug: b/241465879
      Test: atest
      libsurfaceflinger_unittest:libsurfaceflinger_unittest.PowerAdvisorTest
      
      Change-Id: I833e91efb5608d5972220c679a061c9bb51372fa
      57274054
  10. Aug 17, 2022
    • Brian Duddie's avatar
      Reset target SDK version cache on new connection · 0d4ac562
      Brian Duddie authored
      Avoids possibility that a stale cache is used if cleanupConnection()
      does not get called for some reason.
      
      Bug: 230358834
      Test: run POC from b/230358834#comment4
      Change-Id: I2e7422d90cec87167968d56458af9aac6d525506
      0d4ac562
  11. Aug 16, 2022
  12. Aug 15, 2022
  13. Aug 13, 2022
    • Siarhei Vishniakou's avatar
      Allow stylus events in PalmRejector · 6573583a
      Siarhei Vishniakou authored
      After some recent changes, the touchscreen input device has source that
      is a combination of SOURCE_TOUCHSCREEN and SOURCE_STYLUS.
      
      Before this CL, this source is rejected, and therefore palm rejection
      feature is not enabled.
      
      With this CL, any source that has SOURCE_TOUCHSCREEN is allowed. That
      also means that we potentially would invoke the model for stylus events,
      especially if simultaneous touch and stylus are enabled.
      
      The model, however, was never trained on stylus, and is not designed to
      work with it. In preparation to upcoming simultaneous touch+stylus
      feature, in this CL we also remove the stylus pointers before sending
      the data to the model.
      
      The only case where we need to be careful is pointer-down and pointer-up
      events with stylus. In this CL, we drop these events, which should be a
      no-op from the palm rejection model's perpective.
      
      Bug: 241935838
      Test: atest libpalmrejection_test inputflinger_tests
      Change-Id: I760207a82807e03802e72a318fca8b97a4fd7a24
      6573583a
    • Siarhei Vishniakou's avatar
      Call Filter from a separate function · e491fb5a
      Siarhei Vishniakou authored
      The function 'processMotion' has gotten too long. To make it easier to
      reason about, separate some code from the center of the function into a
      new function.
      
      Unfortunately, this new function will have side-effects, but it's still
      easier to understand and reduces the number of local vars.
      
      There's no functional change in this CL.
      
      Bug: 241935838
      Test: atest inputflinger_tests
      Change-Id: I2157798b70299659791ae6ef85b2394e9130b4b3
      e491fb5a
    • Siarhei Vishniakou's avatar
      Add test for heuristic palm rejection · 88151b8f
      Siarhei Vishniakou authored
      For short strokes, the palm rejection code has a heuristic - large
      touches are canceled.
      Since the behaviour is currently present, let's add an integration test
      for it.
      
      Separately, we will also remove 'getLinuxToolType' here because
      tool_type is not used in the palm rejection code.
      
      However, tool_code is used in that code. So let's add getLinuxToolCode
      instead. This piece does not affect the behaviour of the palm rejection
      model, but it makes our inputs more correct.
      
      Bug: 241935838
      Test: atest inputflinger_tests
      Change-Id: Ied9e185bdfc6e892cf3a1069b98101ca8ae9c74b
      88151b8f
  14. Aug 12, 2022
  15. Aug 10, 2022
    • Matt Buckley's avatar
      Disable ADPF CPU hint session rate limiter · 168609b5
      Matt Buckley authored
      After some testing, it has become clear that the rate limiter is
      unhelpful and possibly harmful for performance. Rate limiting also
      happens on PowerHAL side now, rendering this somewhat redundant,
      so this patch disables rate limiting and hint batching on SF side.
      
      Bug: b/241973353
      Bug: b/195990840
      
      Test: manual
      Change-Id: I7ae43d7c9bfc95c94963ae4852d3190ee987c9aa
      (cherry picked from commit 111de034)
      168609b5
    • Matt Buckley's avatar
      Fix SF hint sessions for virtual multi-display case · 3e68cce4
      Matt Buckley authored
      Currently timing for hint sessions in SurfaceFlinger do not work for
      multi-display case with virtual displays (eg: Android Auto). This
      patch fixes that by tracking true sf present completion time to
      supplement hwc time tracking in the sf main thread deadline case.
      
      Bug: b/241465879
      
      Test: manual
      
      Change-Id: I169dd4f4afd2223ed0a648440d5f59dc19dc07f6
      (cherry picked from commit 1809d90e)
      3e68cce4
  16. Aug 04, 2022
  17. Aug 03, 2022
  18. Aug 02, 2022
  19. Aug 01, 2022
  20. Jul 31, 2022
  21. Jul 30, 2022
    • TreeHugger Robot's avatar
    • Vishnu Nair's avatar
      CE: Pass the fence with the cached client composition buffer · 3a49f0a4
      Vishnu Nair authored
      Composition cache checks the buffer id with the client
      composition request to see if we can reuse a buffer if the
      request has not changed. We never bothered with a fence
      here because by the time the cache was accessed, we
      would have sent the buffer to the display at least once.
      
      With composition strategy prediction, our assumption
      breaks. There is a chance we fail to predict the strategy
      but the new strategy results in the same client
      composition request so we can reuse the client
      composition work that was submitted in the beginning
      of the frame.
      
      Test: Repro steps in bug
      Test: go/wm-smoke
      Bug: 239944175
      
      Change-Id: Idbe6a9bb3bba889aa7b459b1046890ea3960982f
      3a49f0a4
  22. Jul 29, 2022
    • Siarhei Vishniakou's avatar
      Dynamic logs for motions in UnwantedInteractionBlocker · d5fe5185
      Siarhei Vishniakou authored
      Currently, we have no way to debug the palm rejection operation in real
      time. On some devices, we are observing touches rejected unreasonably.
      
      For improved debugging, provide a way to turn on the logs at runtime.
      
      Sample logs:
      07-29 20:50:51.938 21364 21461 D UnwantedInteractionBlocker: notifyMotion: NotifyMotionArgs(id=437279320, eventTime=681206765436000, deviceId=4, source=TOUCHSCREEN, action=MOVE, pointerCount=2 pointers={0: id=0 x=1998.0 y=732.0 pressure=1.0 major=78.0 minor=78.0 orientation=1.6}, {1: id=1 x=1651.0 y=705.0 pressure=0.5 major=14.0 minor=14.0 orientation=1.6}, flags=0x00000000)
      07-29 20:50:51.939 21364 21461 D UnwantedInteractionBlocker: Filter: touches = 0 : InProgressTouchEvdev(x=1998, y=732, tracking_id=0, slot=0, pressure=0.996094, major=78, minor=78, tool_type=0, altered=1, was_touching=1, touching=1)
      07-29 20:50:51.939 21364 21461 D UnwantedInteractionBlocker: 1 : InProgressTouchEvdev(x=1651, y=705, tracking_id=1, slot=1, pressure=0.546875, major=14, minor=14, tool_type=0, altered=1, was_touching=1, touching=1)
      07-29 20:50:51.939 21364 21461 D UnwantedInteractionBlocker: Response: slotsToHold = 00000000000000000000, slotsToSuppress = 00000000000000000011
      07-29 20:50:51.939 21364 21461 I UnwantedInteractionBlocker: Palm detected, removing pointer ids {0, 1} after 656ms from NotifyMotionArgs(id=437279320, eventTime=681206765436000, deviceId=4, source=TOUCHSCREEN, action=MOVE, pointerCount=2 pointers={0: id=0 x=1998.0 y=732.0 pressure=1.0 major=78.0 minor=78.0 orientation=1.6}, {1: id=1 x=1651.0 y=705.0 pressure=0.5 major=14.0 minor=14.0 orientation=1.6}, flags=0x00000000)
      07-29 20:50:51.939 21364 21461 D UnwantedInteractionBlocker: enqueueOutboundMotionLocked: NotifyMotionArgs(id=437279320, eventTime=681206765436000, deviceId=4, source=TOUCHSCREEN, action=CANCEL, pointerCount=1 pointers={0: id=1 x=1651.0 y=705.0 pressure=0.5 major=14.0 minor=14.0 orientation=1.6}, flags=0x00000020)
      07-29 20:50:51.947 21364 21461 D UnwantedInteractionBlocker: notifyMotion: NotifyMotionArgs(id=1057496278, eventTime=681206774728000, deviceId=4, source=TOUCHSCREEN, action=MOVE, pointerCount=2 pointers={0: id=0 x=1996.0 y=732.0 pressure=1.0 major=78.0 minor=78.0 orientation=1.6}, {1: id=1 x=1651.0 y=705.0 pressure=0.5 major=14.0 minor=14.0 orientation=1.6}, flags=0x00000000)
      07-29 20:50:51.947 21364 21461 D UnwantedInteractionBlocker: Filter: touches = 0 : InProgressTouchEvdev(x=1996, y=732, tracking_id=0, slot=0, pressure=0.996094, major=78, minor=78, tool_type=0, altered=1, was_touching=1, touching=1)
      07-29 20:50:51.947 21364 21461 D UnwantedInteractionBlocker: 1 : InProgressTouchEvdev(x=1651, y=705, tracking_id=1, slot=1, pressure=0.542969, major=14, minor=14, tool_type=0, altered=1, was_touching=1, touching=1)
      07-29 20:50:51.948 21364 21461 D UnwantedInteractionBlocker: Response: slotsToHold = 00000000000000000000, slotsToSuppress = 00000000000000000011
      
      Bug: 239463037
      Bug: 198472780
      Test: looked at the logs with palm rejection enabled
      Change-Id: I10e54bd0c4ca26fd6197b3ff0069f9799ea91ccf
      d5fe5185
    • Siarhei Vishniakou's avatar
      Do not convert time to float · 229a8804
      Siarhei Vishniakou authored
      The conversion of time to float causes weird behaviour. When the time is
      received in palm rejection code, the time deltas do not match the
      original values seen in Android.
      
      Rather than debug the float conversion, switch to using integral values
      for timestamps.
      After the switch, printing the time difference shows the values as
      expected.
      
      Bug: 240168494
      Test: printed diffs of timestamps inside palm rejection code
      Test: atest inputflinger_tests
      Change-Id: If6af45ba7740de4d70a300a45842bd3d6a069f40
      229a8804
    • Josep del Rio's avatar
      Change palm rejection enabling value · 4b20779b
      Josep del Rio authored
      It looks like we cache the remote configuration value in some instances,
      so we'll resolve this by changing the value we use to enable/disable it,
      and also remove the propagation criteria and use "experiments" and
      "launches" instead.
      
      Bug: 239675985
      Test: flashed device and confirmed that palm rejection is disabled
      
      Change-Id: I9c764ed3402d9244e6dd5928d3ca8388491f7175
      4b20779b
Loading