Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 204e2c5e authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by android-build-merger
Browse files

CameraBase: Don't return an sp<> by reference am: f86177dd am: e1bdaa8f...

CameraBase: Don't return an sp<> by reference am: f86177dd am: e1bdaa8f am: 6cb19125 am: 4f951572 am: 7376ce23
am: 43605e23

Change-Id: I35d434f0efc0cc77f7dc839c554fd164ae0ec4e4
parents c5505da9 43605e23
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ namespace {

// establish binder interface to camera service
template <typename TCam, typename TCamTraits>
const sp<::android::hardware::ICameraService>& CameraBase<TCam, TCamTraits>::getCameraService()
const sp<::android::hardware::ICameraService> CameraBase<TCam, TCamTraits>::getCameraService()
{
    Mutex::Autolock _l(gLock);
    if (gCameraService.get() == 0) {
@@ -141,7 +141,7 @@ sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,
    ALOGV("%s: connect", __FUNCTION__);
    sp<TCam> c = new TCam(cameraId);
    sp<TCamCallbacks> cl = c;
    const sp<::android::hardware::ICameraService>& cs = getCameraService();
    const sp<::android::hardware::ICameraService> cs = getCameraService();

    binder::Status ret;
    if (cs != nullptr) {
@@ -249,7 +249,7 @@ int CameraBase<TCam, TCamTraits>::getNumberOfCameras() {
template <typename TCam, typename TCamTraits>
status_t CameraBase<TCam, TCamTraits>::getCameraInfo(int cameraId,
        struct hardware::CameraInfo* cameraInfo) {
    const sp<::android::hardware::ICameraService>& cs = getCameraService();
    const sp<::android::hardware::ICameraService> cs = getCameraService();
    if (cs == 0) return UNKNOWN_ERROR;
    binder::Status res = cs->getCameraInfo(cameraId, cameraInfo);
    return res.isOk() ? OK : res.serviceSpecificErrorCode();
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ protected:
    virtual void                     binderDied(const wp<IBinder>& who);

    // helper function to obtain camera service handle
    static const sp<::android::hardware::ICameraService>& getCameraService();
    static const sp<::android::hardware::ICameraService> getCameraService();

    sp<TCamUser>                     mCamera;
    status_t                         mStatus;