Camera: Update camera service to use new HIDL HALs, part 1
- Add CameraProviderManager
- Enumerates individual camera provider HAL instances, as well
as the devices they provide
- Handles dynamic provider and device appearance/disappearance
- Maps device names to public API namespace
- Add unit tests for CameraProviderManager
- Add logic to enable new HIDL path
- Switch various bits of service internals to use string camera IDs,
though leaving most camera1-facing bits using int IDs, since that's
what the old API uses.
- Update CameraService to use CameraProviderManager instead of
the legacy camera HAL
- Update clients to pass through provider manager to devices instead
of just camera module
- Still TODO:
- Update Camera3Device to use new HIDL interface
- Update CameraHardwareInterface to use new HIDL interface
- Update dump()
- Update vendor tag handling
Test: New unit tests pass, camera CTS passes with Treble disabled
Bug: 30985004
Bug: 32991422
Change-Id: I7ac41f13b9501d5e53256e28c0465ec70aa3980e
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 3705e8f..5b3509f 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -59,8 +59,8 @@
namespace android {
-Camera3Device::Camera3Device(int id):
- mId(id),
+Camera3Device::Camera3Device(const String8 &id):
+ mId(atoi(id.string())),
mIsConstrainedHighSpeedConfiguration(false),
mHal3Device(NULL),
mStatus(STATUS_UNINITIALIZED),
@@ -77,7 +77,7 @@
ATRACE_CALL();
camera3_callback_ops::notify = &sNotify;
camera3_callback_ops::process_capture_result = &sProcessCaptureResult;
- ALOGV("%s: Created device for camera %d", __FUNCTION__, id);
+ ALOGV("%s: Created device for camera %d", __FUNCTION__, mId);
}
Camera3Device::~Camera3Device()
@@ -256,6 +256,12 @@
return OK;
}
+status_t Camera3Device::initialize(sp<CameraProviderManager> manager) {
+ (void) manager;
+ ALOGE("%s: Not supported yet", __FUNCTION__);
+ return INVALID_OPERATION;
+}
+
status_t Camera3Device::disconnect() {
ATRACE_CALL();
Mutex::Autolock il(mInterfaceLock);