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

Commit a43af985 authored by Wu-cheng Li's avatar Wu-cheng Li Committed by Android (Google) Code Review
Browse files

Merge "Remove new camera connect API."

parents c2dabeb1 08ad5efc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,13 +116,13 @@ status_t Camera::getCameraInfo(int cameraId,
    return cs->getCameraInfo(cameraId, cameraInfo);
}

sp<Camera> Camera::connect(int cameraId, bool force, bool keep)
sp<Camera> Camera::connect(int cameraId)
{
    ALOGV("connect");
    sp<Camera> c = new Camera();
    const sp<ICameraService>& cs = getCameraService();
    if (cs != 0) {
        c->mCamera = cs->connect(c, cameraId, force, keep);
        c->mCamera = cs->connect(c, cameraId);
    }
    if (c->mCamera != 0) {
        c->mCamera->asBinder()->linkToDeath(c);
+2 −8
Original line number Diff line number Diff line
@@ -56,15 +56,12 @@ public:
    }

    // connect to camera service
    virtual sp<ICamera> connect(const sp<ICameraClient>& cameraClient, int cameraId,
                                bool force, bool keep)
    virtual sp<ICamera> connect(const sp<ICameraClient>& cameraClient, int cameraId)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
        data.writeStrongBinder(cameraClient->asBinder());
        data.writeInt32(cameraId);
        data.writeInt32(force);
        data.writeInt32(keep);
        remote()->transact(BnCameraService::CONNECT, data, &reply);
        return interface_cast<ICamera>(reply.readStrongBinder());
    }
@@ -96,10 +93,7 @@ status_t BnCameraService::onTransact(
        case CONNECT: {
            CHECK_INTERFACE(ICameraService, data, reply);
            sp<ICameraClient> cameraClient = interface_cast<ICameraClient>(data.readStrongBinder());
            const int cameraId = data.readInt32();
            const int force = data.readInt32();
            const int keep = data.readInt32();
            sp<ICamera> camera = connect(cameraClient, cameraId, force, keep);
            sp<ICamera> camera = connect(cameraClient, data.readInt32());
            reply->writeStrongBinder(camera->asBinder());
            return NO_ERROR;
        } break;
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public:
    static  int32_t     getNumberOfCameras();
    static  status_t    getCameraInfo(int cameraId,
                                      struct CameraInfo* cameraInfo);
    static  sp<Camera>  connect(int cameraId, bool force, bool keep);
    static  sp<Camera>  connect(int cameraId);
            virtual     ~Camera();
            void        init();

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public:
    virtual status_t        getCameraInfo(int cameraId,
                                          struct CameraInfo* cameraInfo) = 0;
    virtual sp<ICamera>     connect(const sp<ICameraClient>& cameraClient,
                                    int cameraId, bool force, bool keep) = 0;
                                    int cameraId) = 0;
};

// ----------------------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ status_t CameraSource::isCameraAvailable(
    int32_t cameraId) {

    if (camera == 0) {
        mCamera = Camera::connect(cameraId, false, false);
        mCamera = Camera::connect(cameraId);
        if (mCamera == 0) return -EBUSY;
        mCameraFlags &= ~FLAGS_HOT_CAMERA;
    } else {
Loading