Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion services/camera/libcameraservice/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ cc_library_shared {
"android.hardware.camera.device@3.3",
"android.hardware.camera.device@3.4",
"android.hardware.camera.device@3.5",
"android.hardware.camera.device@3.6"
"android.hardware.camera.device@3.6",
"vendor.lineage.camera.motor@1.0"
],

static_libs: [
Expand Down
13 changes: 13 additions & 0 deletions services/camera/libcameraservice/CameraService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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
Expand All @@ -94,6 +96,7 @@ using hardware::camera::common::V1_0::CameraDeviceStatus;
using hardware::camera::common::V1_0::TorchModeStatus;
using hardware::camera2::utils::CameraIdAndSessionConfiguration;
using hardware::camera2::utils::ConcurrentCameraIdCombination;
using vendor::lineage::camera::motor::V1_0::ICameraMotor;

// ----------------------------------------------------------------------------
// Logging support -- this is for debugging only
Expand Down Expand Up @@ -1778,6 +1781,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

Expand Down Expand Up @@ -2833,6 +2841,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,
Expand Down