CameraService: Fix client PID
Client PID is the PID of the client that connects to camera service
directly. Without this, mediaserver won't be able to lock camera when
standalone MediaRecorder is in use.
Bug: 25091611
Change-Id: I6afa9409b6337439bb7186c0ec3f9a412fa9950f
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 007629d..fb71142 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -997,7 +997,10 @@
clientName8.string(), clientUid, clientPid, cameraId.string());
}
+ // Only use passed in clientPid to check permission. Use calling PID as the client PID that's
+ // connected to camera service directly.
originalClientPid = clientPid;
+ clientPid = callingPid;
userid_t clientUserId = multiuser_get_user_id(clientUid);