Camera: Synchronize between provider removal and registration
Because onDeviceStatusChanged is reenterable, in the case of camera provider process crash, the following race condition could happen: 1. Camera provider crashes, onDeviceStatusChanged is called with NOT_PRESENT. camera service calls disconnect to disconnect from CameraDevice. 2. Camera provider comes back online, and onDeviceStatusChanged is called to change the state back to PRESENT. 3. disconnect returns, and the camera state is deleted, resulting in cameraservice to be in bad state. This change synchronizes onRegistration and removeProvider to avoid aforementioned race condition. Test: Camera CTS Test: Add delay in removeProvider and kill provider process while camera is running. Bug: 110837617 Change-Id: I472f1bfebf770d8eb0b2d7eb5f4a0fa26566bdea
Loading
Please register or sign in to comment