Document that some parameters will not be null and fix getSupportedPictureFormats.

This commit is contained in:
Wu-cheng Li
2009-12-04 19:59:18 +08:00
parent 7e90005fcb
commit 9c79938d47

View File

@@ -930,8 +930,8 @@ public class Camera {
/** /**
* Gets the supported preview sizes. * Gets the supported preview sizes.
* *
* @return a List of Size object. null if preview size setting is not * @return a List of Size object. This method will always return a list
* supported. * with at least one element.
*/ */
public List<Size> getSupportedPreviewSizes() { public List<Size> getSupportedPreviewSizes() {
String str = get(KEY_PREVIEW_SIZE + SUPPORTED_VALUES_SUFFIX); String str = get(KEY_PREVIEW_SIZE + SUPPORTED_VALUES_SUFFIX);
@@ -1065,8 +1065,8 @@ public class Camera {
/** /**
* Gets the supported preview formats. * Gets the supported preview formats.
* *
* @return a List of Integer objects. null if preview format setting is * @return a List of Integer objects. This method will always return a
* not supported. * list with at least one element.
*/ */
public List<Integer> getSupportedPreviewFormats() { public List<Integer> getSupportedPreviewFormats() {
String str = get(KEY_PREVIEW_FORMAT + SUPPORTED_VALUES_SUFFIX); String str = get(KEY_PREVIEW_FORMAT + SUPPORTED_VALUES_SUFFIX);
@@ -1104,8 +1104,8 @@ public class Camera {
/** /**
* Gets the supported picture sizes. * Gets the supported picture sizes.
* *
* @return a List of Size objects. null if picture size setting is not * @return a List of Size objects. This method will always return a list
* supported. * with at least one element.
*/ */
public List<Size> getSupportedPictureSizes() { public List<Size> getSupportedPictureSizes() {
String str = get(KEY_PICTURE_SIZE + SUPPORTED_VALUES_SUFFIX); String str = get(KEY_PICTURE_SIZE + SUPPORTED_VALUES_SUFFIX);
@@ -1143,12 +1143,18 @@ public class Camera {
/** /**
* Gets the supported picture formats. * Gets the supported picture formats.
* *
* @return a List of Integer objects (values are PixelFormat.XXX). null * @return a List of Integer objects (values are PixelFormat.XXX). This
* if picture setting is not supported. * method will always return a list with at least one element.
*/ */
public List<Integer> getSupportedPictureFormats() { public List<Integer> getSupportedPictureFormats() {
String str = get(KEY_PICTURE_SIZE + SUPPORTED_VALUES_SUFFIX); String str = get(KEY_PICTURE_FORMAT + SUPPORTED_VALUES_SUFFIX);
return splitInt(str); ArrayList<Integer> formats = new ArrayList<Integer>();
for (String s : split(str)) {
int f = pixelFormatForCameraFormat(s);
if (f == PixelFormat.UNKNOWN) continue;
formats.add(f);
}
return formats;
} }
private String cameraFormatForPixelFormat(int pixel_format) { private String cameraFormatForPixelFormat(int pixel_format) {
@@ -1443,8 +1449,8 @@ public class Camera {
/** /**
* Gets the supported focus modes. * Gets the supported focus modes.
* *
* @return a List of FOCUS_MODE_XXX string constants. null if focus mode * @return a List of FOCUS_MODE_XXX string constants. This method will
* setting is not supported. * always return a list with at least one element.
*/ */
public List<String> getSupportedFocusModes() { public List<String> getSupportedFocusModes() {
String str = get(KEY_FOCUS_MODE + SUPPORTED_VALUES_SUFFIX); String str = get(KEY_FOCUS_MODE + SUPPORTED_VALUES_SUFFIX);