summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-02-08 19:41:54 +0100
committerDan Pasanen <dan.pasanen@gmail.com>2017-02-09 18:59:02 +0000
commit342b6177119011ecfa2a7f97fceb4027186944e1 (patch)
tree61ca59be03214bc68673102fea9d98646b07d8f6
parent8613b0502046742d80cb9eee7cd5e9eea2ee356f (diff)
downloadandroid_packages_apps_Snap-342b6177119011ecfa2a7f97fceb4027186944e1.zip
android_packages_apps_Snap-342b6177119011ecfa2a7f97fceb4027186944e1.tar.gz
android_packages_apps_Snap-342b6177119011ecfa2a7f97fceb4027186944e1.tar.bz2
Snap: VideoModule: Restore check on mPreferenceRead
This fixes the following crash when switching from picture mode to video mode for the first time: FATAL EXCEPTION: main Process: org.cyanogenmod.snap, PID: 4243 java.lang.NullPointerException: Attempt to read from field 'int android.media.CamcorderProfile.videoFrameWidth' on a null object reference at com.android.camera.VideoModule.updateCameraParametersInitialize(VideoModule.java:2778) at com.android.camera.VideoModule.setCameraParameters(VideoModule.java:2822) at com.android.camera.VideoModule.startPreview(VideoModule.java:1353) at com.android.camera.VideoModule.onPreviewUIReady(VideoModule.java:3260) at com.android.camera.VideoUI.surfaceCreated(VideoUI.java:956) at android.view.SurfaceView.updateWindow(SurfaceView.java:618) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:161) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2205) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6343) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:621) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6126) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Change-Id: I8f449aaa943636a9b3ce590425e8611def8df590
-rw-r--r--src/com/android/camera/VideoModule.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index ca67530..1f88ccc 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1317,7 +1317,7 @@ public class VideoModule extends BaseModule<VideoUI> implements
private void startPreview() {
Log.e(TAG, String.format("startPreview paused=%b device=%b params=%b", mPaused, mCameraDevice == null, mParameters == null), new Throwable());
- if (mPaused || mCameraDevice == null || mParameters == null) {
+ if (!mPreferenceRead || mPaused || mCameraDevice == null || mParameters == null) {
return;
}