Cameraserver: Use multiple hwbinder threads
Some interactions between camera service and hwservicemanager require
multiple threads to execute without deadlocks, such as calling
getService() from within an onRegistered() callback.
Increase thread count to 3 to accomodate.
Also switch the order of listener registration and legacy provider
addition back to what it was originally.
Test: No deadlock when camera service is restarted
Bug: 35096594
Change-Id: I6def961d5765958fef284c0a1820e903abc851ef
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index c40809f..f6ad7d7 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -54,9 +54,6 @@
mListener = listener;
mServiceProxy = proxy;
- // See if there's a passthrough HAL, but let's not complain if there's not
- addProvider(kLegacyProviderName, /*expected*/ false);
-
// Registering will trigger notifications for all already-known providers
bool success = mServiceProxy->registerForNotifications(
/* instance name, empty means no filter */ "",
@@ -67,6 +64,9 @@
return INVALID_OPERATION;
}
+ // See if there's a passthrough HAL, but let's not complain if there's not
+ addProvider(kLegacyProviderName, /*expected*/ false);
+
return OK;
}