summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/PhotoMenu.java14
-rw-r--r--src/com/android/camera/PhotoModule.java13
-rw-r--r--src/com/android/camera/PhotoUI.java11
3 files changed, 26 insertions, 12 deletions
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index 1aea279a3..f4a4b36ce 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -684,8 +684,11 @@ public class PhotoMenu extends MenuController
@Override
public void onClick(View v) {
addSceneMode();
- View view = mUI.getPreviewMenuLayout().getChildAt(0);
- animateSlideIn(view, previewMenuSize, false);
+ ViewGroup menuLayout = mUI.getPreviewMenuLayout();
+ if (menuLayout != null) {
+ View view = menuLayout.getChildAt(0);
+ animateSlideIn(view, previewMenuSize, false);
+ }
}
});
}
@@ -833,8 +836,11 @@ public class PhotoMenu extends MenuController
@Override
public void onClick(View v) {
addFilterMode();
- View view = mUI.getPreviewMenuLayout().getChildAt(0);
- animateSlideIn(view, previewMenuSize, false);
+ ViewGroup menuLayout = mUI.getPreviewMenuLayout();
+ if (menuLayout != null) {
+ View view = mUI.getPreviewMenuLayout().getChildAt(0);
+ animateSlideIn(view, previewMenuSize, false);
+ }
}
});
}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 1e238be80..93c093e4a 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2097,10 +2097,12 @@ public class PhotoModule
}
//Need to disable focus for ZSL mode
- if(mSnapshotMode == CameraInfo.CAMERA_SUPPORT_MODE_ZSL) {
- mFocusManager.setZslEnable(true);
- } else {
- mFocusManager.setZslEnable(false);
+ if (mFocusManager != null) {
+ if (mSnapshotMode == CameraInfo.CAMERA_SUPPORT_MODE_ZSL) {
+ mFocusManager.setZslEnable(true);
+ } else {
+ mFocusManager.setZslEnable(false);
+ }
}
// If the user wants to do a snapshot while the previous one is still
@@ -2108,7 +2110,8 @@ public class PhotoModule
// one and re-start the preview. Snapshot in progress also includes the
// state that autofocus is focusing and a picture will be taken when
// focus callback arrives.
- if ((mFocusManager.isFocusingSnapOnFinish() || mCameraState == SNAPSHOT_IN_PROGRESS)
+ if ((((mFocusManager != null) && mFocusManager.isFocusingSnapOnFinish())
+ || mCameraState == SNAPSHOT_IN_PROGRESS)
&& !mIsImageCaptureIntent) {
mSnapshotOnIdle = true;
return;
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index b4e08c398..461fd67f3 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -553,7 +553,9 @@ public class PhotoUI implements PieListener,
mMenuButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- mMenu.openFirstLevel();
+ if(mMenu != null){
+ mMenu.openFirstLevel();
+ }
}
});
if (mController.isImageCaptureIntent()) {
@@ -917,8 +919,11 @@ public class PhotoUI implements PieListener,
}
public boolean sendTouchToMenu(MotionEvent ev) {
- View v = mMenuLayout.getChildAt(0);
- return v.dispatchTouchEvent(ev);
+ if (mMenuLayout != null) {
+ View v = mMenuLayout.getChildAt(0);
+ return v.dispatchTouchEvent(ev);
+ }
+ return false;
}
public void dismissSceneModeMenu() {