Dynamically disable View-based rotary haptics
Before this change, View-based rotary haptics was configured for the
entire device, controlled by an XML config. As long as this config is
enabled, the ScrollFeedbackProvider's (SFP) rotary feedback was also
disabled (to avoid duplicate rotary haptics).
With this change, the decision to enable/disable the View-based rotary
haptics will be View-specific. If we detect that a View implementation
is directly using the SFP API, we will favor the SFP API and disable the
View-based rotary haptics. This allows us to continue providing rotary
haptics for View implementations without SFP integration, while cleanly
disabling rotary View-based rotary haptics in cases where SFP has been
integrated to the specific View.
Bug: 377998870
Test: manually on a widget extending View, with SFP integration
Test: manually on a widget extending View, with no SFP integration
Test: manually on a widget NOT extending View, with SFP integration
Test: atest RotaryScrollHapticsTest HapticScrollFeedbackProviderTest
Flag: android.view.flags.dynamic_view_rotary_haptics_configuration
Change-Id: Iac63b5f7046f216f8ec958245021da5fa0a40fa7
5 files changed