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

Commit 41d3046e authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "CameraBase: Don't return an sp<> by reference" into nyc-dev

parents 4f34250a f86177dd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,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) {
@@ -118,7 +118,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) {
@@ -226,7 +226,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
@@ -115,7 +115,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;