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

Skip to content
Commit 71db5f82 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Respect deviceId in SensorManager cache.

Do not use the cached SensorManager if the device association
of the underlying package has changed.

Since the SensorManager is cached per package, if the deviceId
changes, then the native SensorManager will always return the wrong
sensors. This is seen in the failing CTS.

The most straight-forward solution is to refresh the cache when the
device for that UID has changed. It would be better to have an API
that takes a deviceId but that's a longer term fix - b/306575095

This change is effectively flagged by the read-only flag
android.companion.virtual.flags.enable_native_vdm. When it is
disabled, the deviceId will always be 0 (i.e. default device).

Test: atest VirtualSensorNativeTest
Bug: 306575095
Fix: 317495754
Change-Id: If02beb9f3eceec19c104ae03fcb0a8fefb46f85f
parent a5643cb0
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