frameworks/base: switch CameraService to a HAL module
This patch changes CameraService to load a camera HAL module, instead of
linking directly against a library that implements the CameraHardwareInterface
class.
CameraHardwareInterface no longer defines the API to the camera HAL. Instead,
this is now in HAL header hardware/camera.h. We keep CamerHardwareInterface as
a class local to CameraService, which wraps around the new HAL calls. In the
future, we may remove this class entirely and have CameraService call the HAL
methods directly.
Change-Id: I5c61ac40078fc0b50bbac5881a556fe6c8837641
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 9a9ab0e..5e2d571 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -19,9 +19,8 @@
#define ANDROID_SERVERS_CAMERA_CAMERASERVICE_H
#include <binder/BinderService.h>
-
#include <camera/ICameraService.h>
-#include <camera/CameraHardwareInterface.h>
+#include <hardware/camera.h>
/* This needs to be increased if we can have more cameras */
#define MAX_CAMERAS 2
@@ -30,6 +29,7 @@
class MemoryHeapBase;
class MediaPlayer;
+class CameraHardwareInterface;
class CameraService :
public BinderService<CameraService>,
@@ -53,6 +53,7 @@
virtual status_t dump(int fd, const Vector<String16>& args);
virtual status_t onTransact(uint32_t code, const Parcel& data,
Parcel* reply, uint32_t flags);
+ virtual void onFirstRef();
enum sound_kind {
SOUND_SHUTTER = 0,
@@ -199,6 +200,8 @@
// is found to be disabled. It returns true if mLock is grabbed.
bool lockIfMessageWanted(int32_t msgType);
};
+
+ camera_module_t *mModule;
};
} // namespace android