summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2009-12-11 20:00:15 +0800
committerWu-cheng Li <wuchengli@google.com>2009-12-14 14:45:01 +0800
commit59595d1cad16653e73bfdf811386b037f8925569 (patch)
tree4bb1c70c5eeb014a0dcd958f2aa6e1503c7d317a /src
parentb65537df206fd69317109ab8147440b0ba9f9c25 (diff)
downloadLegacyCamera-59595d1cad16653e73bfdf811386b037f8925569.zip
LegacyCamera-59595d1cad16653e73bfdf811386b037f8925569.tar.gz
LegacyCamera-59595d1cad16653e73bfdf811386b037f8925569.tar.bz2
Avoid initializeRecorder during onPause.
When on-screen setting is visible and home key is pressed, onPause will set mSetting to invisible and initializeRecorder() will be called in onVisibilityChanged(). That will cause exception if surface holder is still null. bug 2319111
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/VideoCamera.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index bc7bca1..b3ddb19 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -1087,7 +1087,9 @@ public class VideoCamera extends NoSearchActivity
releaseMediaRecorder();
mPreferences.registerOnSharedPreferenceChangeListener(this);
} else {
- initializeRecorder();
+ // When mSetting is set to invisible in onPause, we should not
+ // initialize recorder.
+ if (!mPausing) initializeRecorder();
mPreferences.unregisterOnSharedPreferenceChangeListener(this);
}
}