diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-27 13:42:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-27 13:42:05 -0700 |
commit | 17f213bc528cf296e133e9ec9c9e0ce5dce41781 (patch) | |
tree | d586c4bdd9fec5220de10b8a2a24863616fb5281 | |
parent | 04ab1c767199bc674a7b7424fdd0d527c32252ac (diff) | |
parent | 325ac475c51dc0d54503f725179ea2d9353485bb (diff) | |
download | frameworks_base-17f213bc528cf296e133e9ec9c9e0ce5dce41781.zip frameworks_base-17f213bc528cf296e133e9ec9c9e0ce5dce41781.tar.gz frameworks_base-17f213bc528cf296e133e9ec9c9e0ce5dce41781.tar.bz2 |
Merge change 602 into donut
* changes:
Bug fix(1807910): media recorder crash due to the use of locked camera object (last part) - remove an unused Camera constructor - add a check on the argument in Camera::create() method
-rw-r--r-- | include/ui/Camera.h | 1 | ||||
-rw-r--r-- | libs/ui/Camera.cpp | 20 |
2 files changed, 7 insertions, 14 deletions
diff --git a/include/ui/Camera.h b/include/ui/Camera.h index 12fa20f..fd851d9 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<ICamera>& camera); // to be removed static sp<Camera> create(const sp<ICamera>& camera); static sp<Camera> connect(); ~Camera(); diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index 0fba82c..41577c4 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -64,22 +64,16 @@ Camera::Camera() init(); } -Camera::Camera(const sp<ICamera>& 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> Camera::create(const sp<ICamera>& camera) { + LOGV("create"); + if (camera == 0) { + LOGE("camera remote is a NULL pointer"); + return 0; + } + sp<Camera> c = new Camera(); - // connect this client to existing camera remote if (camera->connect(c) == NO_ERROR) { c->mStatus = NO_ERROR; c->mCamera = camera; |