Loading services/camera/libcameraservice/CameraService.cpp +87 −77 Original line number Diff line number Diff line Loading @@ -277,6 +277,7 @@ sp<ICamera> CameraService::connect( sp<Client> client; { Mutex::Autolock lock(mServiceLock); if (!canConnectUnsafe(cameraId, clientPackageName, cameraClient->asBinder(), Loading @@ -292,7 +293,8 @@ sp<ICamera> CameraService::connect( // If there are other non-exclusive users of the camera, // this will tear them down before we can reuse the camera if (isValidCameraId(cameraId)) { updateStatus(ICameraServiceListener::STATUS_NOT_AVAILABLE, cameraId); updateStatus(ICameraServiceListener::STATUS_NOT_AVAILABLE, cameraId); } switch(deviceVersion) { Loading @@ -318,14 +320,18 @@ sp<ICamera> CameraService::connect( } if (!connectFinishUnsafe(client, client->asBinder())) { // this is probably not recoverable.. but maybe the client can try again // this is probably not recoverable.. maybe the client can try again updateStatus(ICameraServiceListener::STATUS_AVAILABLE, cameraId); return NULL; } mClient[cameraId] = client; LOG1("CameraService::connect X (id %d, this pid is %d)", cameraId, getpid()); LOG1("CameraService::connect X (id %d, this pid is %d)", cameraId, getpid()); } // important: release the mutex here so the client can call back // into the service from its destructor (can be at the end of the call) return client; } Loading Loading @@ -357,6 +363,8 @@ sp<IProCameraUser> CameraService::connect( return NULL; } sp<ProClient> client; { Mutex::Autolock lock(mServiceLock); { sp<Client> client; Loading @@ -367,14 +375,13 @@ sp<IProCameraUser> CameraService::connect( } } sp<ProClient> client; int facing = -1; int deviceVersion = getDeviceVersion(cameraId, &facing); switch(deviceVersion) { case CAMERA_DEVICE_API_VERSION_1_0: ALOGE("Camera id %d uses HALv1, doesn't support ProCamera", cameraId); ALOGE("Camera id %d uses HALv1, doesn't support ProCamera", cameraId); return NULL; break; case CAMERA_DEVICE_API_VERSION_2_0: Loading @@ -398,6 +405,9 @@ sp<IProCameraUser> CameraService::connect( LOG1("CameraService::connectPro X (id %d, this pid is %d)", cameraId, getpid()); } // important: release the mutex here so the client can call back // into the service from its destructor (can be at the end of the call) return client; } Loading Loading
services/camera/libcameraservice/CameraService.cpp +87 −77 Original line number Diff line number Diff line Loading @@ -277,6 +277,7 @@ sp<ICamera> CameraService::connect( sp<Client> client; { Mutex::Autolock lock(mServiceLock); if (!canConnectUnsafe(cameraId, clientPackageName, cameraClient->asBinder(), Loading @@ -292,7 +293,8 @@ sp<ICamera> CameraService::connect( // If there are other non-exclusive users of the camera, // this will tear them down before we can reuse the camera if (isValidCameraId(cameraId)) { updateStatus(ICameraServiceListener::STATUS_NOT_AVAILABLE, cameraId); updateStatus(ICameraServiceListener::STATUS_NOT_AVAILABLE, cameraId); } switch(deviceVersion) { Loading @@ -318,14 +320,18 @@ sp<ICamera> CameraService::connect( } if (!connectFinishUnsafe(client, client->asBinder())) { // this is probably not recoverable.. but maybe the client can try again // this is probably not recoverable.. maybe the client can try again updateStatus(ICameraServiceListener::STATUS_AVAILABLE, cameraId); return NULL; } mClient[cameraId] = client; LOG1("CameraService::connect X (id %d, this pid is %d)", cameraId, getpid()); LOG1("CameraService::connect X (id %d, this pid is %d)", cameraId, getpid()); } // important: release the mutex here so the client can call back // into the service from its destructor (can be at the end of the call) return client; } Loading Loading @@ -357,6 +363,8 @@ sp<IProCameraUser> CameraService::connect( return NULL; } sp<ProClient> client; { Mutex::Autolock lock(mServiceLock); { sp<Client> client; Loading @@ -367,14 +375,13 @@ sp<IProCameraUser> CameraService::connect( } } sp<ProClient> client; int facing = -1; int deviceVersion = getDeviceVersion(cameraId, &facing); switch(deviceVersion) { case CAMERA_DEVICE_API_VERSION_1_0: ALOGE("Camera id %d uses HALv1, doesn't support ProCamera", cameraId); ALOGE("Camera id %d uses HALv1, doesn't support ProCamera", cameraId); return NULL; break; case CAMERA_DEVICE_API_VERSION_2_0: Loading @@ -398,6 +405,9 @@ sp<IProCameraUser> CameraService::connect( LOG1("CameraService::connectPro X (id %d, this pid is %d)", cameraId, getpid()); } // important: release the mutex here so the client can call back // into the service from its destructor (can be at the end of the call) return client; } Loading