Camera1: Release mSerializationLock before calling into CameraService

When disconnecting, API1 client calls into CameraService
with mSerializationLock held. CameraService calls internally
serializes on mServiceLock. There are other situations where
CameraService may call into the client with mServiceLock held.

If these two things happen at the same time, there is a chance of
a deadlock as CameraService calls into the API1 client and waits for
mSerializationLock, and API1 client calls into CameraService and waits
for mServiceLock.

To break the cycle, this CL releases mSerializationLock before calling
into CameraService.

Bug: 351778072
Test: atest CtsCameraTestCases:android.hardware.cts.CameraTest
Flag: com.android.internal.camera.flags.api1_release_binderlock_before_cameraservice_disconnect
Change-Id: Ida983882589c568b5bcc610c2d327d9d1b6a9828
diff --git a/camera/camera_platform.aconfig b/camera/camera_platform.aconfig
index fe10e12..121b9c4 100644
--- a/camera/camera_platform.aconfig
+++ b/camera/camera_platform.aconfig
@@ -247,3 +247,13 @@
         purpose: PURPOSE_BUGFIX
     }
 }
+
+flag {
+    namespace: "camera_platform"
+    name: "api1_release_binderlock_before_cameraservice_disconnect"
+    description: "Drop mSerializationLock in Camera1 client when calling into CameraService"
+    bug: "351778072"
+    metadata {
+        purpose: PURPOSE_BUGFIX
+    }
+}