Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add maximum recording length resource. DO NOT MERGE

bug:7075393

Change-Id: Ieb18d955d809193f652c41eb36d52f2acb8e18e0
  • Loading branch information...
commit 73653366e2aeb3e0669a50b870b3d2218d583b77 1 parent 16687a1
Angus Kong authored
22 res/values/config.xml
View
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Camera app resources that may need to be customized
+ for different hardware or product builds. -->
+<resources>
+ <!-- Maximum recording length in milliseconds. 0 means unlimited. -->
+ <integer name="max_video_recording_length">0</integer>
+</resources>
13 src/com/android/camera/CameraSettings.java
View
@@ -20,6 +20,7 @@
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.res.Resources;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.Size;
@@ -59,8 +60,6 @@
public static final int CURRENT_VERSION = 5;
public static final int CURRENT_LOCAL_VERSION = 2;
- public static final int DEFAULT_VIDEO_DURATION = 0; // no limit
-
private static final String TAG = "CameraSettings";
private final Context mContext;
@@ -133,6 +132,15 @@ public static boolean setCameraPictureSize(
return false;
}
+ public static int getMaxVideoDuration(Context context) {
+ int duration = 0; // in milliseconds, 0 means unlimited.
+ try {
+ duration = context.getResources().getInteger(R.integer.max_video_recording_length);
+ } catch (Resources.NotFoundException ex) {
+ }
+ return duration;
+ }
+
private void initPreference(PreferenceGroup group) {
ListPreference videoQuality = group.findPreference(KEY_VIDEO_QUALITY);
ListPreference timeLapseInterval = group.findPreference(KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL);
@@ -444,7 +452,6 @@ public static Object readEffectParameter(SharedPreferences pref) {
return null;
}
-
public static void restorePreferences(Context context,
ComboPreferences preferences, Parameters parameters) {
int currentCameraId = readPreferredCameraId(preferences);
2  src/com/android/camera/VideoCamera.java
View
@@ -663,7 +663,7 @@ private void readVideoPreferences() {
intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0);
mMaxVideoDurationInMs = 1000 * seconds;
} else {
- mMaxVideoDurationInMs = CameraSettings.DEFAULT_VIDEO_DURATION;
+ mMaxVideoDurationInMs = CameraSettings.getMaxVideoDuration(this);
}
// Set effect
Please sign in to comment.
Something went wrong with that request. Please try again.