summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Cai <peter@typeblog.net>2019-06-20 20:22:38 +0800
committerƁukasz Patron <priv.luk@gmail.com>2019-12-09 23:28:18 +0100
commit06f5eac47765ce1fd3ac2eaf373e3a5e92071874 (patch)
tree72f0ca15581c3b601f0c4f8f7ec06ac179866a84
parentf52c6fcda5e7443d15ef66e0471f8fd78ab96993 (diff)
downloadframeworks_av-lineage-17.0.tar.gz
frameworks_av-lineage-17.0.tar.bz2
frameworks_av-lineage-17.0.zip
CameraService: Support hooks for motorized cameralineage-17.0
Change-Id: I0905374e9bb277f35464c581d610fa80e8b6d872
-rw-r--r--services/camera/libcameraservice/Android.bp1
-rw-r--r--services/camera/libcameraservice/CameraService.cpp13
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 d97abf86dc..4484818637 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
@@ -1531,6 +1534,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
@@ -2398,6 +2406,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,