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

Skip to content
Commit 5d7e5151 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Avoid possible race condition during provider init

The current sequence of registering for provider notifications
and trying to add a legacy provider could introduce a race
condition leading to a deadlock. The "onRegistration" callback
will try to acquire "mInterfaceMutex" which is still held during
 the execution of "addProvider" for legacy. However "addProvider"
could get suspended waiting on the HIDL provider interface. If this
happens and the same thread that unblocks the service query tries
to notify the provider manager, then we will end up in a deadlock.
To avoid this, the initialization sequence can be modified a bit.
First add the legacy provider and then register for notifications.

Bug: 35096594
Test: Manual using stop/start of cameraserver
Change-Id: Ia381ae6bf567525cabd3f51246a192ddac37b7f8
parent 231653e9
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