From 02627adfa3d240d817e34af69be8d07e9c66c136 Mon Sep 17 00:00:00 2001 From: James Dong Date: Tue, 23 Feb 2010 18:05:39 -0800 Subject: Set duration and still image encoding quality using Java API - rebased bug - 2375978 --- src/com/android/camera/Camera.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/com/android/camera/Camera.java') diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index cbb6aa1..b3dd504 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -37,6 +37,7 @@ import android.location.LocationManager; import android.location.LocationProvider; import android.media.AudioManager; import android.media.ToneGenerator; +import android.media.CameraProfile; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -2161,8 +2162,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, } private static String[] mQualityStrings = {"superfine", "fine", "normal"}; - private static String[] mQualityNumbers = SystemProperties.get( - "ro.media.enc.jpeg.quality", "85,75,65").split(","); + private static int[] mQualityNumbers = CameraProfile.getImageEncodingQualityLevels(); private static int DEFAULT_QUALITY = 85; // Translate from a quality string to a quality number using the system @@ -2174,12 +2174,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, if (index == -1 || index > mQualityNumbers.length - 1) { return DEFAULT_QUALITY; } - - try { - return Integer.parseInt(mQualityNumbers[index]); - } catch (NumberFormatException ex) { - return DEFAULT_QUALITY; - } + return mQualityNumbers[index]; } } -- cgit v1.1