summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraSettings.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-10-03 15:57:29 +0800
committerWu-cheng Li <wuchengli@google.com>2010-10-03 23:25:35 +0800
commitc300a0266d634bb7a1e2df816e97bad2836991ac (patch)
tree678e4ed6d10426db5080ac5c8d68f9727635af74 /src/com/android/camera/CameraSettings.java
parentccb9df3be2ded7ee4bbeb54181a787e9001c73ee (diff)
downloadLegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.tar.gz
LegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.tar.bz2
LegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.zip
Pass camera id to CamcorderProfile.hasProfile.
In the future, android.hardware.Camera.Parameters should have a getCameraId. It is easier for apps to know which camera it is now. Change-Id: Iae529c02d89b64a9158a0bdc4b4d0cfd293e7270
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r--src/com/android/camera/CameraSettings.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index cde3d9da..e187864f 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -77,11 +77,13 @@ public class CameraSettings {
private final Context mContext;
private final Parameters mParameters;
private final CameraInfo[] mCameraInfo;
+ private final int mCameraId;
public CameraSettings(Activity activity, Parameters parameters,
- CameraInfo[] cameraInfo) {
+ int cameraId, CameraInfo[] cameraInfo) {
mContext = activity;
mParameters = parameters;
+ mCameraId = cameraId;
mCameraInfo = cameraInfo;
}
@@ -143,7 +145,7 @@ public class CameraSettings {
ListPreference flashMode = group.findPreference(KEY_FLASH_MODE);
ListPreference focusMode = group.findPreference(KEY_FOCUS_MODE);
ListPreference exposure = group.findPreference(KEY_EXPOSURE);
- IconListPreference cameraId =
+ IconListPreference cameraIdPref =
(IconListPreference)group.findPreference(KEY_CAMERA_ID);
ListPreference videoFlashMode =
group.findPreference(KEY_VIDEOCAMERA_FLASH_MODE);
@@ -167,7 +169,8 @@ public class CameraSettings {
// Filter out unsupported settings / options
if (videoTimeLapseQuality != null) {
- filterUnsupportedOptions(group, videoTimeLapseQuality, getSupportedTimeLapseProfiles());
+ filterUnsupportedOptions(group, videoTimeLapseQuality,
+ getSupportedTimeLapseProfiles(mCameraId));
}
if (pictureSize != null) {
filterUnsupportedOptions(group, pictureSize, sizeListToStringList(
@@ -198,18 +201,18 @@ public class CameraSettings {
videoFlashMode, mParameters.getSupportedFlashModes());
}
if (exposure != null) buildExposureCompensation(group, exposure);
- if (cameraId != null) buildCameraId(group, cameraId);
+ if (cameraIdPref != null) buildCameraId(group, cameraIdPref);
}
- private static List<String> getSupportedTimeLapseProfiles() {
+ private static List<String> getSupportedTimeLapseProfiles(int cameraId) {
ArrayList<String> supportedProfiles = new ArrayList<String>();
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_480P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_480P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_480P));
}
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_720P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_720P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_720P));
}
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_1080P));
}