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

Commit 22d69a14 authored by Biswarup Pal's avatar Biswarup Pal
Browse files

Prevent crash in CoreSettingsObserver

When any setting changes, CoreSettingsObserver enumerates all
virtual devices and fetches the setting value for every virtual
device id (by creating an explicit device context and calling
Settings#getString with that context). However, by the time it
calls Context#createDeviceContext with a device id, it is possible
(though rare) that the virtual device is gone. This CL handles that
exception and skips the fetching of settings for any invalid device
id.

Test: atest CoreSettingsObserverTest
Fixes: 425014464
Flag: android.companion.virtualdevice.flags.device_aware_settings_override
Change-Id: I0a39d4208fef0d4cfe46a2c487ffc27a14ccdd57
parent 100f285b
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