Add non-static methods in ViewConfiguration
... for tapTimeout, doubleTapTimeout, doubelTapMinTime, scrollFriction.
These values are derived from resources, which can be overlaid
per deviceId (go/runtime-resource-overlay-per-deviceid-and-displayid).
The static methods use application context internally, which means that
an app having activities running on two devices together (eg: one
activity on the phone and another on a Chromebook at the same time)
would get a single value on both devices, and result in unexpected
behaviour in one of the devices (Note that application context has
the deviceId of the most recently launched activity). Hence we add
non-static versions of the same methods to fetch the appropriate
overlaid resource value based on the deviceId of the context with which
the ViewConfiguration has been constructed (instead of using the
application context).
A follow-up CL will migrate usages of the static methods from various
places in the framework (wherever possible) to use the non-static ones.
Test: atest ViewConfigurationTest
Flag: android.companion.virtualdevice.flags.viewconfiguration_apis
Bug: 405726390
Change-Id: Ia4c3bc8e54492328adc1fc87a08a914c692d2fea
2 files changed