client;
Mutex::Autolock lock(mServiceLock);
if (mClient[cameraId] != 0) {
client = mClient[cameraId].promote();
if (client != 0) {
if (cameraClient->asBinder() == client->getCameraClient()->asBinder()) {
LOG1("CameraService::connect X (pid %d) (the same client)",
callingPid);
return client;
} else {
LOGW("CameraService::connect X (pid %d) rejected (existing client).",
callingPid);
return NULL;
}
}
mClient[cameraId].clear();
}
sphardware = HAL_openCameraHardware(cameraId);
if (hardware == NULL) {
LOGE("Fail to open camera hardware (id=%d)", cameraId);
return NULL;
}
CameraInfo info;
HAL_getCameraInfo(cameraId, &info);
client =