diff options
author | Owen Lin <owenlin@google.com> | 2011-03-02 15:32:50 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2011-03-02 15:32:50 +0800 |
commit | 38a16262e8936afd22a83cf6b5b5a758de8f4f9e (patch) | |
tree | 2a09ae84242c8fe1a51f9477c766e07642e82a70 /src | |
parent | 4a70e66b58207703f8a705548efcd5353106e452 (diff) | |
download | LegacyCamera-38a16262e8936afd22a83cf6b5b5a758de8f4f9e.zip LegacyCamera-38a16262e8936afd22a83cf6b5b5a758de8f4f9e.tar.gz LegacyCamera-38a16262e8936afd22a83cf6b5b5a758de8f4f9e.tar.bz2 |
Fix a NPE in error handling code.
bug: 3499208
Change-Id: I45071a0d373cff2c58d9bbd89a46109750183020
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 754a4ba..360e6f2 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -19,8 +19,8 @@ package com.android.camera; import com.android.camera.ui.CamcorderHeadUpDisplay; import com.android.camera.ui.CameraPicker; import com.android.camera.ui.GLRootView; -import com.android.camera.ui.IndicatorWheel; import com.android.camera.ui.HeadUpDisplay; +import com.android.camera.ui.IndicatorWheel; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; @@ -1557,8 +1557,8 @@ public class VideoCamera extends ActivityBase + mCurrentVideoFilename); needToRegisterRecording = true; } catch (RuntimeException e) { - Log.e(TAG, "stop fail: " + e.getMessage()); - deleteVideoFile(mVideoFilename); + Log.e(TAG, "stop fail", e); + if (mVideoFilename != null) deleteVideoFile(mVideoFilename); } mMediaRecorderRecording = false; showRecordingUI(false); @@ -1673,7 +1673,7 @@ public class VideoCamera extends ActivityBase // For better approximation calculate fractional number of frames captured. // This will update the video time at a higher resolution. double numberOfFrames = (double) deltaMs / mTimeBetweenTimeLapseFrameCaptureMs; - return (long) (numberOfFrames / (double) mProfile.videoFrameRate * 1000); + return (long) (numberOfFrames / mProfile.videoFrameRate * 1000); } private void updateRecordingTime() { @@ -1932,6 +1932,7 @@ public class VideoCamera extends ActivityBase private int mLocation[] = new int[2]; private class PopupGestureListener extends GestureDetector.SimpleOnGestureListener { + @Override public boolean onDown(MotionEvent e) { // Check if the popup window is visible. View v = mIndicatorWheel.getActivePopupWindow(); |