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

Skip to content
Commit 6ba8eb27 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

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
parent 30401e0d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment