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

Commit f35ffc97 authored by Peter Cai's avatar Peter Cai Committed by Michael Bestas
Browse files

CameraService: Support hooks for motorized camera

Change-Id: I0905374e9bb277f35464c581d610fa80e8b6d872
parent 411893a7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ cc_library_shared {
        "android.hardware.camera.device@3.3",
        "android.hardware.camera.device@3.4",
        "android.hardware.camera.device@3.5",
        "vendor.lineage.camera.motor@1.0",
    ],

    export_shared_lib_headers: [
+13 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@
#include "utils/TagMonitor.h"
#include "utils/CameraThreadState.h"

#include <vendor/lineage/camera/motor/1.0/ICameraMotor.h>

namespace {
    const char* kPermissionServiceName = "permission";
}; // namespace anonymous
@@ -91,6 +93,7 @@ using hardware::ICameraServiceProxy;
using hardware::ICameraServiceListener;
using hardware::camera::common::V1_0::CameraDeviceStatus;
using hardware::camera::common::V1_0::TorchModeStatus;
using vendor::lineage::camera::motor::V1_0::ICameraMotor;

// ----------------------------------------------------------------------------
// Logging support -- this is for debugging only
@@ -1539,6 +1542,11 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
        } else {
            // Otherwise, add client to active clients list
            finishConnectLocked(client, partial);

            sp<ICameraMotor> cameraMotor = ICameraMotor::getService();
            if (cameraMotor != nullptr) {
                cameraMotor->onConnect(cameraId.string());
            }
        }
    } // lock is destroyed, allow further connect calls

@@ -2402,6 +2410,11 @@ binder::Status CameraService::BasicClient::disconnect() {
    }
    mDisconnected = true;

    sp<ICameraMotor> cameraMotor = ICameraMotor::getService();
    if (cameraMotor != nullptr) {
        cameraMotor->onDisconnect(mCameraIdStr.string());
    }

    sCameraService->removeByClient(this);
    sCameraService->logDisconnected(mCameraIdStr, mClientPid, String8(mClientPackageName));
    sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,