summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureUI.java
diff options
context:
space:
mode:
authorpezhan <pezhan@codeaurora.org>2017-01-23 10:42:46 +0800
committerpezhan <pezhan@codeaurora.org>2017-01-23 10:42:46 +0800
commit097d0a39d4ca7f7b494c08831fa0f9d2d8dd2f43 (patch)
treef57cfadf8b241b28b3f922c5f4182320659e5dc5 /src/com/android/camera/CaptureUI.java
parenta9d36894dedb0d24e1e246b388780e58d3e837d8 (diff)
downloadandroid_packages_apps_Snap-097d0a39d4ca7f7b494c08831fa0f9d2d8dd2f43.tar.gz
android_packages_apps_Snap-097d0a39d4ca7f7b494c08831fa0f9d2d8dd2f43.tar.bz2
android_packages_apps_Snap-097d0a39d4ca7f7b494c08831fa0f9d2d8dd2f43.zip
SnapdragonCamera:Fix Camera crash when taking picture with flash light on.
If the CaptureModule is noraml mode ,the layout will not be inflated.If use it without check it's null, will cause force crash. Need to check if it's not the mormal mode,can use it safely. Change-Id: I4a8f1ddeaaf473e2fb99b418051bd54d6ebb9131 CRs-Fixed: 1114432
Diffstat (limited to 'src/com/android/camera/CaptureUI.java')
-rwxr-xr-xsrc/com/android/camera/CaptureUI.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 465755db0..2c7cb6abf 100755
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -487,17 +487,25 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
protected void showCapturedImageForReview(byte[] jpegData, int orientation, boolean mirror) {
mDecodeTaskForReview = new CaptureUI.DecodeImageForReview(jpegData, orientation, mirror);
mDecodeTaskForReview.execute();
- mPreviewLayout.setVisibility(View.VISIBLE);
- CameraUtil.fadeIn(mReviewDoneButton);
- CameraUtil.fadeIn(mReviewRetakeButton);
+ if (getCurrentIntentMode() != CaptureModule.INTENT_MODE_NORMAL) {
+ mPreviewLayout.setVisibility(View.VISIBLE);
+ CameraUtil.fadeIn(mReviewDoneButton);
+ CameraUtil.fadeIn(mReviewRetakeButton);
+ }
}
protected void showRecordVideoForReview(Bitmap preview) {
- mReviewImage.setImageBitmap(preview);
- mPreviewLayout.setVisibility(View.VISIBLE);
- mReviewPlayButton.setVisibility(View.VISIBLE);
- CameraUtil.fadeIn(mReviewDoneButton);
- CameraUtil.fadeIn(mReviewRetakeButton);
+ if (getCurrentIntentMode() != CaptureModule.INTENT_MODE_NORMAL) {
+ mReviewImage.setImageBitmap(preview);
+ mPreviewLayout.setVisibility(View.VISIBLE);
+ mReviewPlayButton.setVisibility(View.VISIBLE);
+ CameraUtil.fadeIn(mReviewDoneButton);
+ CameraUtil.fadeIn(mReviewRetakeButton);
+ }
+ }
+
+ private int getCurrentIntentMode() {
+ return mModule.getCurrentIntentMode();
}
private void toggleMakeup() {