diff options
author | Zhijun He <zhijunhe@google.com> | 2013-09-25 23:57:24 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-25 23:57:24 +0000 |
commit | 822ac0bada06b2185b4d5e8304160b680a72cff2 (patch) | |
tree | 824e21a680b0e2aa8d3bb84ce2ed03d29cd04bf1 /core/java/android/hardware | |
parent | 8b21bbe440f1561107bc09d26c7dc12eef01fb21 (diff) | |
parent | 2001188be30649198972a3199a4322d6f7f5f93d (diff) | |
download | frameworks_base-822ac0bada06b2185b4d5e8304160b680a72cff2.zip frameworks_base-822ac0bada06b2185b4d5e8304160b680a72cff2.tar.gz frameworks_base-822ac0bada06b2185b4d5e8304160b680a72cff2.tar.bz2 |
Merge "Camera2: Implement CameraManager#getCameraCharacteristics" into klp-dev
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r-- | core/java/android/hardware/ICameraService.aidl | 3 | ||||
-rw-r--r-- | core/java/android/hardware/camera2/CameraManager.java | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/hardware/ICameraService.aidl b/core/java/android/hardware/ICameraService.aidl index fc54828..542af6a 100644 --- a/core/java/android/hardware/ICameraService.aidl +++ b/core/java/android/hardware/ICameraService.aidl @@ -22,6 +22,7 @@ import android.hardware.IProCameraUser; import android.hardware.IProCameraCallbacks; import android.hardware.camera2.ICameraDeviceUser; import android.hardware.camera2.ICameraDeviceCallbacks; +import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.camera2.utils.BinderHolder; import android.hardware.ICameraServiceListener; import android.hardware.CameraInfo; @@ -58,4 +59,6 @@ interface ICameraService int addListener(ICameraServiceListener listener); int removeListener(ICameraServiceListener listener); + + int getCameraCharacteristics(int cameraId, out CameraMetadataNative info); } diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java index af0512e..798ad7b 100644 --- a/core/java/android/hardware/camera2/CameraManager.java +++ b/core/java/android/hardware/camera2/CameraManager.java @@ -176,10 +176,17 @@ public final class CameraManager { } } - // TODO: implement and call a service function to get the capabilities on C++ side + CameraMetadataNative info = new CameraMetadataNative(); + try { + mCameraService.getCameraCharacteristics(Integer.valueOf(cameraId), info); + } catch(CameraRuntimeException e) { + throw e.asChecked(); + } catch(RemoteException e) { + // impossible + return null; + } - // TODO: get properties from service - return new CameraCharacteristics(new CameraMetadataNative()); + return new CameraCharacteristics(info); } /** |