Skip to content
Snippets Groups Projects
  1. Sep 22, 2024
  2. Sep 19, 2024
  3. Jul 31, 2024
  4. Jul 23, 2024
    • Dominik Laskowski's avatar
      SF: Restore mStateLock mutex for modesetting · a515fd50
      Dominik Laskowski authored
      In order to fix a deadlock during display hotplug, the modesetting mutex
      was changed from mStateLock to a granular DisplayModeController lock, in
      the following CLs:
      
          I30ec756f134d2d67a70ac8797008dc792eac035e
          Iaae02d95e175e55f52f65da1481b64f1f533a04c (reverted)
      
      This exposed a data race leading to a crash, which, unlike the deadlock,
      affects all devices with refresh rate switching. The race will be fixed
      by:
      
          If6141d2928643e82b3251b321e18c300cd8c201c (WIP)
      
      As a stopgap until then, restore mStateLock (on top of the DMC lock) on
      the main thread to fix the race, but reintroduce the deadlock. The lock
      was already restored on the idle timer thread by the reverted CL above.
      
      Fixes: 348827779
      Flag: com.android.graphics.surfaceflinger.flags.connected_display
      Test: Manual (foldable, connected display)
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b2fc4235635f5160ed5ae35c1fbd1fcc3e45c59f)
      Merged-In: Ie15de10d16eefeb65289574b120d2ef4cc09d6c0
      Change-Id: Ie15de10d16eefeb65289574b120d2ef4cc09d6c0
      a515fd50
  5. Jul 20, 2024
  6. Jul 10, 2024
  7. Jun 28, 2024
  8. Jun 27, 2024
  9. Jun 21, 2024
    • Dominik Laskowski's avatar
      SF: Fix pacesetter promotion for folded mirroring · 575aa723
      Dominik Laskowski authored
      The pacesetter display is demoted/promoted in response to a hotplug. On
      foldables, the promoted display was hard-coded to the inner display, so
      a hotplug while folded would incorrectly use that powered-off display as
      the pacesetter, causing system-wide jank until the next fold/unfold.
      
      Fixes: 347248313
      Flag: EXEMPT bugfix
      Test: Connect and disconnect external display while folded.
      Test: Fold and unfold while external display is connected.
      Test: Pacesetter is still correct on folded/unfolded boot.
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3ff44c7e852f5614514a15dcec78ba7857e5d010)
      Merged-In: Id5cb29c3cbaa8ed455a15d8be3a32e79a470cce5
      Change-Id: Id5cb29c3cbaa8ed455a15d8be3a32e79a470cce5
      575aa723
  10. Jun 14, 2024
    • Prabir Pradhan's avatar
      InputTracer: Add timestamp to perfetto trace packets · 4fc32e04
      Prabir Pradhan authored
      Use the event processing time as the packet timestamp for input events,
      and use the delivery time as the packet timestamp for dispatch events.
      
      Bug: 332714237
      Bug: 210460522
      Test: atest inputflinger_tests
      Test: manual with perfetto
      Change-Id: I30f4c21dfee68603d0dad01d205f8a5581e6db31
      4fc32e04
    • Prabir Pradhan's avatar
      InputDispatcher: Fix pointer count when canceling a subset of pointers · 33cfc6d2
      Prabir Pradhan authored
      There was a bug in the logic for calculating the pointer coords and
      properties for canceling a subset of pointers. It was introduced when we
      refactored storing the coords in a vector rather than using a
      fixed-length array with a pointerCount variable in the following change:
      I91b4a88ec5df3f017ade8a6e55be3d3c1281de75
      
      Bug: 346342507
      Test: atest inputflinger_tests
      Flag: NONE bug fix
      
      Change-Id: Ie9a5fbd5ba1fd75c53b7289a93573ec2d0d1947b
      33cfc6d2
    • Ady Abraham's avatar
      SF: trace the render rate of an app · 1d0cae97
      Ady Abraham authored
      Add a trace point for both SF and apps when the render rate
      is overridden.
      
      Bug: 347314033
      Test: manual
      Change-Id: I87dc9b17a4c1f97fa43b025cfa684f43c20c5a25
      1d0cae97
    • Vishnu Nair's avatar
      Trigger windowinfo updates when alpha changes · ab942863
      Vishnu Nair authored
      Input and TrustedPresentationListener logic relies on layer alpha. This change ensures
      that SurfaceFlinger sends the updated window info when only the alpha changes.
      
      Fixes: 325254898
      Test: presubmit
      Flag: EXEMPT bugfix
      Change-Id: I6b9a5b2874add278245cb682c5362c18403c70b0
      ab942863
  11. Jun 13, 2024
    • Vishnu Nair's avatar
      Update snapshot changes flags when visibility changes · b4a6a771
      Vishnu Nair authored
      Layerhistory walks through all snapshots and checks the change
      flags before updating its state. When a layer moves offscreen,
      we update its snapshot but did not update the change flag. This
      cl fixes this.
      
      Bug: 345021645
      Test: presubmit
      Flag: EXEMPT bugfix
      
      Change-Id: Icee06279f0fa8b0f4c0539e99dde8960ba3fab31
      b4a6a771
  12. Jun 12, 2024
    • Dominik Laskowski's avatar
      SF: Isolate modesetting in DisplayModeController · 5c989f5c
      Dominik Laskowski authored
      Move the per-display state machine for modesetting from DisplayDevice to
      DMC. In lieu of mStateLock, protect display lookup from multiple threads
      using a mutex internal to DMC, which fixes the following deadlock:
      
      OneShotTimer::loop
          SF::requestDisplayModes
          mStateLock
      
      SF::commit
          mStateLock
          SF::processDisplayChangesLocked (hotplug or resolution change)
          Scheduler::demotePacesetterDisplay
          OneShotTimer::stop
      
      A notable change is that {initiate,finalize}DisplayModeChange(s) are no
      longer called under mStateLock, thanks to DMC's granular, internal lock.
      finalizeDisplayModeChange still locks mStateLock for resolution changes.
      
      Add an ActiveModeListener to DMC and register a callback in SF to update
      the refresh rate overlay, which still lives in DisplayDevice for now.
      
      Fixes: 329450361
      Bug: 241285876
      Test: DisplayModeControllerTest
      Test: libsurfaceflinger_unittest
      Change-Id: I30ec756f134d2d67a70ac8797008dc792eac035e
      5c989f5c
    • Arpit Singh's avatar
      Dismiss the mouse pointer while typing on keyboard · b65e2bd8
      Arpit Singh authored
      Fixes the borken UX to dismiss the mouse pointer while user is typing on
      the physical keyboard.
      
      Bug: b/338652288
      Test: atest inputflinger_tests
      Change-Id: Ifc4bfd20a44650634d007fbcfc75bf497d5f4623
      b65e2bd8
    • Elliott Hughes's avatar
      libc++fs is part of libc++ now. · 11b53588
      Elliott Hughes authored
      Change-Id: I113a2677857a397cd84d9ba48b030bc455a1d388
      11b53588
  13. Jun 10, 2024
    • Prabir Pradhan's avatar
      Revert "Revert "AndroidInputEvent: Migrate from TracePacket to W..." · 6ef947ad
      Prabir Pradhan authored
      Re-land "AndroidInputEvent: Migrate from TracePacket to WinscopeE..."
      
      Reason for revert: Second attempt. Topic was split in the first
      attempt, causing build failures.
      
      Reverted changes: /q/submissionid:27769399-revert-27683745-migrate-input-trace-winscope-OTCESQVQHW
      
      Bug: 332714237
      Change-Id: Ia5b8ec30023462806bcc67421c8257e436c8e8c4
      6ef947ad
    • Prabir Pradhan's avatar
      MotionEvent: Consolidate functions to transform PointerCoords · 4b8d36c0
      Prabir Pradhan authored
      Remove PointerCoords::transform(), which is a duplicate of
      MotionEvent::calculateTranformedCoords().
      
      Bug: 342349872
      Test: atest inputflinger_tests libinput_tests
      Change-Id: I7610a0475a16e9964817f63efa67b291cb7aaf0a
      4b8d36c0
    • Prabir Pradhan's avatar
      MotionEvent: Differentiate directional support for AXIS_ORIENTATION · 9a53b55a
      Prabir Pradhan authored
      We have three cases for handling AXIS_ORIENTATION:
      1. Orientation is not supported by the input device, so the value for
         AXIS_ORIENTATION should always be 0, regardless of display rotation.
      2. Orientation is supported, but a "direction" is not specified, like
         for touchscreens and touchpads. The orientation must be in the range
         [-pi/2, pi/2] for all display rotations.
      3. Orientation is fully supported, and the value is in the range [-pi,
         pi] for all display rotations.
      
      It is insufficient to rely on whether or not the PointerCoords has the
      bit for AXIS_ORIENTATION set to determine whether the event has a valid
      orientation. This is because we always skip setting values of 0 for any
      axis in PointerCoords to save space during serialization.
      
      To support these three cases, we introduce two new MotionEvent private
      flags. These are flags that are not exposed to Java and to the public
      APIs.
      
      Bug: 263310669
      Test: atest TouchScreenTest libinput_tests inputflinger_tests
      Change-Id: Iaa38afe35b00de74fbc5eefce25191bea52c2ea6
      9a53b55a
    • Priyanka Advani's avatar
      Revert "AndroidInputEvent: Migrate from TracePacket to WinscopeE..." · 8779d083
      Priyanka Advani authored
      Revert submission 27683745-migrate-input-trace-winscope
      
      Reason for revert: Droidmonitor created revert due to b/346371417. 
      
      Reverted changes: /q/submissionid:27683745-migrate-input-trace-winscope
      
      Change-Id: Ice87da2681a76b47d582c7ce957c598bb8c7fdb9
      8779d083
    • Prabir Pradhan's avatar
      AndroidInputEvent: Migrate from TracePacket to WinscopeExtenstions · 38ed5444
      Prabir Pradhan authored
      Bug: 332714237
      Test: atest inputflinger_tests
      Change-Id: I00dc546f6628ad8a33d0f6a6c1bbda10a24ed46e
      Merged-In: I00dc546f6628ad8a33d0f6a6c1bbda10a24ed46e
      38ed5444
    • Prabir Pradhan's avatar
      InputDispatcher: Fix multi-display Pointer Capture · 9d3d561b
      Prabir Pradhan authored
      There is an existing requirement that a window must both have focus and
      be on the focused display to be able to gain Pointer Capture.
      
      This means that focus changes on non-focused displays should not affect
      Pointer Capture, and that a window must lose capture if its display
      loses focus.
      
      Verify these requirements with a test.
      
      Bug: 342229227
      Test: atest inputflinger_tests
      Change-Id: I7b1c73b7759d8f20436ee401ba657a5dc8ead7a5
      9d3d561b
    • Prabir Pradhan's avatar
      AndroidInputEvent: Migrate from TracePacket to WinscopeExtenstions · ff517071
      Prabir Pradhan authored
      Bug: 332714237
      Test: atest inputflinger_tests
      Change-Id: I00dc546f6628ad8a33d0f6a6c1bbda10a24ed46e
      ff517071
    • Vaibhav Devmurari's avatar
      Cleanup: Use ModifierState enum in input.rs in sticky keys filter · 770b6e4a
      Vaibhav Devmurari authored
      Test: none
      Bug: 245989146
      Change-Id: If2c46c9fb228ebb35bc7c66a4d58bf27ec000f4b
      770b6e4a
  14. Jun 07, 2024
    • Dennis Shen's avatar
      switch over to use new storage read api instead of · 247dda20
      Dennis Shen authored
      server_configurable_flags, this new read api lib will be needed for new
      codegened aconfig flag lib.
      
      Bug: 321077378
      Test m and avd
      
      Change-Id: Ia345d4a798c1d7f1861512a3e9aa0ab5e72d407f
      247dda20
    • Melody Hsu's avatar
      Remove main thread double hop from screenshots · 8c42cf19
      Melody Hsu authored
      The SF main thread is accessed twice during screenshots,
      which leads to possible inconsistent states between jumps
      onto the main thread. Removing the double hop preserves
      correctness and reduces the amount of computation taking place
      on the main thread. The only time the main thread should be
      accessed should be when getting layer snapshots. All other
      work related to screenshots can take place in a binder thread.
      
      Bug: b/294936197, b/285553970
      Test: atest SurfaceFlinger_test
      Flag: com.android.graphics.surfaceflinger.flags.single_hop_screenshot
      Change-Id: If9fd36f82c2d550bc0821b52fef3ea88b8099116
      8c42cf19
Loading