Loading
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