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

Commit b38aea6f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Add debug logs for disconnectLocked." into tm-dev am: 43eceebc am: 226cddb4

parents 1c2e6dab 226cddb4
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -491,6 +491,7 @@ CameraDevice::disconnectLocked(sp<ACameraCaptureSession>& session) {
    }
    }


    if (mRemote != nullptr) {
    if (mRemote != nullptr) {
        ALOGD("%s: binder disconnect reached", __FUNCTION__);
        auto ret = mRemote->disconnect();
        auto ret = mRemote->disconnect();
        if (!ret.isOk()) {
        if (!ret.isOk()) {
            ALOGE("%s: Transaction error while disconnecting device %s", __FUNCTION__,
            ALOGE("%s: Transaction error while disconnecting device %s", __FUNCTION__,
+4 −1
Original line number Original line Diff line number Diff line
@@ -243,20 +243,23 @@ status_t Camera2ClientBase<TClientBase>::dumpDevice(
template <typename TClientBase>
template <typename TClientBase>
binder::Status Camera2ClientBase<TClientBase>::disconnect() {
binder::Status Camera2ClientBase<TClientBase>::disconnect() {
    ATRACE_CALL();
    ATRACE_CALL();
    ALOGD("Camera %s: start to disconnect", TClientBase::mCameraIdStr.string());
    Mutex::Autolock icl(mBinderSerializationLock);
    Mutex::Autolock icl(mBinderSerializationLock);


    ALOGD("Camera %s: serializationLock acquired", TClientBase::mCameraIdStr.string());
    binder::Status res = binder::Status::ok();
    binder::Status res = binder::Status::ok();
    // Allow both client and the media server to disconnect at all times
    // Allow both client and the media server to disconnect at all times
    int callingPid = CameraThreadState::getCallingPid();
    int callingPid = CameraThreadState::getCallingPid();
    if (callingPid != TClientBase::mClientPid &&
    if (callingPid != TClientBase::mClientPid &&
        callingPid != TClientBase::mServicePid) return res;
        callingPid != TClientBase::mServicePid) return res;


    ALOGV("Camera %s: Shutting down", TClientBase::mCameraIdStr.string());
    ALOGD("Camera %s: Shutting down", TClientBase::mCameraIdStr.string());


    // Before detaching the device, cache the info from current open session.
    // Before detaching the device, cache the info from current open session.
    // The disconnected check avoids duplication of info and also prevents
    // The disconnected check avoids duplication of info and also prevents
    // deadlock while acquiring service lock in cacheDump.
    // deadlock while acquiring service lock in cacheDump.
    if (!TClientBase::mDisconnected) {
    if (!TClientBase::mDisconnected) {
        ALOGD("Camera %s: start to cacheDump", TClientBase::mCameraIdStr.string());
        Camera2ClientBase::getCameraService()->cacheDump();
        Camera2ClientBase::getCameraService()->cacheDump();
    }
    }