summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-23 18:05:39 -0800
committerJames Dong <jdong@google.com>2010-02-25 15:13:12 -0800
commit02627adfa3d240d817e34af69be8d07e9c66c136 (patch)
tree3e990279b13e1477b1448f4933c7e71e480826a1 /src/com/android
parente7a53d0c5c3b8434e7ee8b92072ec8c47fe12cdb (diff)
downloadLegacyCamera-02627adfa3d240d817e34af69be8d07e9c66c136.zip
LegacyCamera-02627adfa3d240d817e34af69be8d07e9c66c136.tar.gz
LegacyCamera-02627adfa3d240d817e34af69be8d07e9c66c136.tar.bz2
Set duration and still image encoding quality using Java API
- rebased bug - 2375978
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/camera/Camera.java11
-rw-r--r--src/com/android/camera/CameraSettings.java5
2 files changed, 6 insertions, 10 deletions
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];
}
}
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index db82a75..6df7803 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -20,6 +20,8 @@ import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
+import android.media.CamcorderProfile;
+import android.media.CamcorderProfile.Quality;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.Size;
import android.os.SystemProperties;
@@ -60,8 +62,7 @@ public class CameraSettings {
public static final int CURRENT_VERSION = 3;
// max mms video duration in seconds.
- public static final int MMS_VIDEO_DURATION =
- SystemProperties.getInt("ro.media.enc.lprof.duration", 60);
+ public static final int MMS_VIDEO_DURATION = CamcorderProfile.getMmsRecordingDurationInSeconds();
public static final boolean DEFAULT_VIDEO_QUALITY_VALUE = true;