summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Camera.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2010-03-26 19:10:37 +0800
committerOwen Lin <owenlin@google.com>2010-03-30 15:54:59 +0800
commitb2b23846d89c63ba0d28bbc7627022e6b9fa620b (patch)
tree28e5448eb3248b2d94a5dc1e770356fc9395e823 /src/com/android/camera/Camera.java
parentc557947a5897106421fec68b082539317e4b25d0 (diff)
downloadLegacyCamera-b2b23846d89c63ba0d28bbc7627022e6b9fa620b.zip
LegacyCamera-b2b23846d89c63ba0d28bbc7627022e6b9fa620b.tar.gz
LegacyCamera-b2b23846d89c63ba0d28bbc7627022e6b9fa620b.tar.bz2
Fix one more NPE. (Second run)
Bug: 2529339 Change-Id: Idbfa4e6950a9e1ee3259226697d1cffa34dd23fa
Diffstat (limited to 'src/com/android/camera/Camera.java')
-rw-r--r--src/com/android/camera/Camera.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 2ab4d24..74d4547 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -308,13 +308,11 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
if (!mIsImageCaptureIntent) {
setOrientationIndicator(mLastOrientation);
}
- if (mGLRootView != null) {
- mGLRootView.queueEvent(new Runnable() {
- public void run() {
- mHeadUpDisplay.setOrientation(mLastOrientation);
- }
- });
- }
+ mGLRootView.queueEvent(new Runnable() {
+ public void run() {
+ mHeadUpDisplay.setOrientation(mLastOrientation);
+ }
+ });
}
}
};
@@ -1277,13 +1275,14 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
closeCamera();
resetScreenOn();
- if (mGLRootView != null) {
+ if (!isFinishing()) {
mGLRootView.onPause();
if (mHeadUpDisplay != null) {
mHeadUpDisplay.setGpsHasSignal(false);
mHeadUpDisplay.collapse();
}
}
+
if (mFirstTimeInitialized) {
mOrientationListener.disable();
if (!mIsImageCaptureIntent) {
@@ -2069,10 +2068,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
private boolean switchToVideoMode() {
if (isFinishing() || !isCameraIdle()) return false;
MenuHelper.gotoVideoMode(this);
- if (mGLRootView != null) {
- ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView);
- mGLRootView = null;
- }
+ ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView);
+ mHandler.removeMessages(FIRST_TIME_INIT);
finish();
return true;
}