diff --git a/include/ui/Camera.h b/include/ui/Camera.h index 12fa20f105b4d..fd851d9efcf1d 100644 --- a/include/ui/Camera.h +++ b/include/ui/Camera.h @@ -78,7 +78,6 @@ class Camera : public BnCameraClient, public IBinder::DeathRecipient { public: // construct a camera client from an existing remote - Camera(const sp& camera); // to be removed static sp create(const sp& camera); static sp connect(); ~Camera(); diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index 0fba82c74d491..41577c45574a3 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -64,22 +64,16 @@ Camera::Camera() init(); } -Camera::Camera(const sp& camera) -{ - init(); - // connect this client to existing camera remote - if (camera->connect(this) == NO_ERROR) { - mStatus = NO_ERROR; - mCamera = camera; - camera->asBinder()->linkToDeath(this); - } -} - - +// construct a camera client from an existing camera remote sp Camera::create(const sp& camera) { + LOGV("create"); + if (camera == 0) { + LOGE("camera remote is a NULL pointer"); + return 0; + } + sp c = new Camera(); - // connect this client to existing camera remote if (camera->connect(c) == NO_ERROR) { c->mStatus = NO_ERROR; c->mCamera = camera;