summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2016-07-19 22:55:02 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-07-19 22:55:02 -0700
commitcfbfa14182d1d726bbe0856da8949e6a847a8ece (patch)
tree87ac341d2aae18a641337892e48f86bc735511bb
parent789d5cafd5ee42e8b061066a0471db8a7f63ea5e (diff)
parenteb2e874fbb1b28249b604fc150cfaa4bfb2cb315 (diff)
downloadandroid_packages_apps_Snap-cfbfa14182d1d726bbe0856da8949e6a847a8ece.tar.gz
android_packages_apps_Snap-cfbfa14182d1d726bbe0856da8949e6a847a8ece.tar.bz2
android_packages_apps_Snap-cfbfa14182d1d726bbe0856da8949e6a847a8ece.zip
Merge "SnapdragonCamera: Use resume/start based on the SDK version" into camera.lnx.1.0-dev.1.0
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/VideoModule.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 0f40702ce..612660450 100644..100755
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -79,6 +79,7 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.HashMap;
+import java.lang.reflect.Method;
public class VideoModule implements CameraModule,
VideoController,
@@ -103,6 +104,9 @@ public class VideoModule implements CameraModule,
private static final long SHUTTER_BUTTON_TIMEOUT = 0L; // 0ms
+ public static final boolean HAS_RESUME_SUPPORTED =
+ Build.VERSION.SDK_INT > Build.VERSION_CODES.M;
+
/**
* An unpublished intent flag requesting to start recording straight away
* and return as soon as recording is stopped.
@@ -1930,7 +1934,16 @@ public class VideoModule implements CameraModule,
mMediaRecorderPausing = false;
mRecordingStartTime = SystemClock.uptimeMillis();
updateRecordingTime();
- mMediaRecorder.start();
+ if (!HAS_RESUME_SUPPORTED){
+ mMediaRecorder.start();
+ } else {
+ try {
+ Method resumeRec = Class.forName("android.media.MediaRecorder").getMethod("resume");
+ resumeRec.invoke(mMediaRecorder);
+ } catch (Exception e) {
+ Log.v(TAG, "resume method not implemented");
+ }
+ }
}
private boolean stopVideoRecording() {