Add non-static methods in ViewConfiguration
... for longPressTimeout and multiPressTimeout. These values are derived from settings, which can be overridden per deviceId (go/device-aware-settings). 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 overridden settings 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: I0bd2f01df772019d836938f2555f61b87cfb620a
Loading
Please register or sign in to comment