diff options
author | Chien-Yu Chen <cychen@google.com> | 2015-02-24 10:28:19 -0800 |
---|---|---|
committer | Yin-Chia Yeh <yinchiayeh@google.com> | 2015-03-24 11:52:20 -0700 |
commit | 676b21b30edbd74d7b9aae247961a1ffde1b8993 (patch) | |
tree | b75567ef13d0c3b235e94fcf3e38d576ab505f96 /services/camera/libcameraservice/CameraFlashlight.cpp | |
parent | 0e4421286b92a81e952f53210227adbf05d97c25 (diff) | |
download | frameworks_av-676b21b30edbd74d7b9aae247961a1ffde1b8993.zip frameworks_av-676b21b30edbd74d7b9aae247961a1ffde1b8993.tar.gz frameworks_av-676b21b30edbd74d7b9aae247961a1ffde1b8993.tar.bz2 |
camera: update CameraModule
1. Add more accessor methods to CameraModule to prevent exposing
raw module pointer
2. Use KeyedVector to replace array
Bug: 19897963
Change-Id: I111cc093f09f5fb3c4b13693d5d0687e1f441058
Diffstat (limited to 'services/camera/libcameraservice/CameraFlashlight.cpp')
-rw-r--r-- | services/camera/libcameraservice/CameraFlashlight.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/services/camera/libcameraservice/CameraFlashlight.cpp b/services/camera/libcameraservice/CameraFlashlight.cpp index 6fda9b2..8613ac6 100644 --- a/services/camera/libcameraservice/CameraFlashlight.cpp +++ b/services/camera/libcameraservice/CameraFlashlight.cpp @@ -55,8 +55,7 @@ status_t CameraFlashlight::createFlashlightControl(const String8& cameraId) { status_t res = OK; - if (mCameraModule->getRawModule()->module_api_version >= - CAMERA_MODULE_API_VERSION_2_4) { + if (mCameraModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4) { mFlashControl = new ModuleFlashControl(*mCameraModule, *mCallbacks); if (mFlashControl == NULL) { ALOGV("%s: cannot create flash control for module api v2.4+", @@ -66,8 +65,8 @@ status_t CameraFlashlight::createFlashlightControl(const String8& cameraId) { } else { uint32_t deviceVersion = CAMERA_DEVICE_API_VERSION_1_0; - if (mCameraModule->getRawModule()->module_api_version >= - CAMERA_MODULE_API_VERSION_2_0) { + if (mCameraModule->getModuleApiVersion() >= + CAMERA_MODULE_API_VERSION_2_0) { camera_info info; res = mCameraModule->getCameraInfo( atoi(String8(cameraId).string()), &info); @@ -224,8 +223,7 @@ status_t CameraFlashlight::prepareDeviceOpen(const String8& cameraId) { return NO_INIT; } - if (mCameraModule->getRawModule()->module_api_version < - CAMERA_MODULE_API_VERSION_2_4) { + if (mCameraModule->getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_4) { // framework is going to open a camera device, all flash light control // should be closed for backward compatible support. mFlashControl.clear(); @@ -274,8 +272,7 @@ status_t CameraFlashlight::deviceClosed(const String8& cameraId) { if (mOpenedCameraIds.size() != 0) return OK; - if (mCameraModule->getRawModule()->module_api_version < - CAMERA_MODULE_API_VERSION_2_4) { + if (mCameraModule->getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_4) { // notify torch available for all cameras with a flash int numCameras = mCameraModule->getNumberOfCameras(); for (int i = 0; i < numCameras; i++) { |