Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3714b29 authored by Biswarup Pal's avatar Biswarup Pal
Browse files

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
parent 67dc8e82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment