Camera: Fix race between notifyDeviceStateChange and removeProvider
Make a copy of mProviders in notifyDeviceStateChange to avoid race
condition between notifyDeviceStateChange and removeProvider.
When iterating through mProviders, we temporarly unlock mInterfaceMutex.
Because of that, it's possible some providers have been removed from
mProviders during iteration, causing invalid memory access.
Test: Vendor testing, Camera CTS
Bug: 234146453
Change-Id: I69cbeff07bacc905f34e4fbd0ba666c677ccf1a7
1 file changed