OSDN Git Service

Check if surface holder is null in initializeRecorder. do not merge
authorWu-cheng Li <wuchengli@google.com>
Fri, 12 Nov 2010 04:22:15 +0000 (12:22 +0800)
committerWu-cheng Li <wuchengli@google.com>
Fri, 12 Nov 2010 05:24:30 +0000 (13:24 +0800)
If shutter button is pressed before surface changed,
surface holder can be null. Recording should be ignored.

bug:3187885
Change-Id: I61406f3c44342db28f0ebeddc788d2d1d621fc1b

src/com/android/camera/VideoCamera.java

index 0c0a6d9..48ffea6 100644 (file)
@@ -931,6 +931,11 @@ public class VideoCamera extends NoSearchActivity
         // If the mCameraDevice is null, then this activity is going to finish
         if (mCameraDevice == null) return;
 
+        if (mSurfaceHolder == null) {
+            Log.v(TAG, "Surface holder is null. Wait for surface changed.");
+            return;
+        }
+
         Intent intent = getIntent();
         Bundle myExtras = intent.getExtras();