diff options
author | Peter Cai <peter@typeblog.net> | 2019-06-20 20:22:38 +0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-11 19:14:58 +0200 |
commit | f35ffc971427b1659b65492d4ed08c278bf4e6c5 (patch) | |
tree | 528bd87904bd0fa39446c86411ab2e46aef701c6 | |
parent | 411893a776d8ef7327e5d86da6476e9779f94eaa (diff) | |
download | frameworks_av-staging/lineage-17.0_merge-android-10.0.0_r9.tar.gz frameworks_av-staging/lineage-17.0_merge-android-10.0.0_r9.tar.bz2 frameworks_av-staging/lineage-17.0_merge-android-10.0.0_r9.zip |
CameraService: Support hooks for motorized camerastaging/lineage-17.0_merge-android-10.0.0_r9
Change-Id: I0905374e9bb277f35464c581d610fa80e8b6d872
-rw-r--r-- | services/camera/libcameraservice/Android.bp | 1 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp index 4427cb8cf6..c4bc0f1a9f 100644 --- a/services/camera/libcameraservice/Android.bp +++ b/services/camera/libcameraservice/Android.bp @@ -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: [ diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index cca11784db..6d264c1d12 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -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, |