diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-08-21 17:50:51 +0800 |
---|---|---|
committer | Likai Ding <likaid@codeaurora.org> | 2014-10-15 14:19:26 +0800 |
commit | 565c2e86be7fd0c7bf1ba37d975ee6bff4715333 (patch) | |
tree | fc32a482c9ffb414c9c3f57077361e93b4b85ef5 /src/com | |
parent | d7810337255f08f3c89e2fb02ca393fc2997ca8d (diff) | |
download | android_packages_apps_Snap-565c2e86be7fd0c7bf1ba37d975ee6bff4715333.tar.gz android_packages_apps_Snap-565c2e86be7fd0c7bf1ba37d975ee6bff4715333.tar.bz2 android_packages_apps_Snap-565c2e86be7fd0c7bf1ba37d975ee6bff4715333.zip |
Camera2: fix camera carsh when mPieRender is null
The autofocus maybe called before onCameraOpened, and mPieRender is
not initialize which lead to camera crash.
Check null when show focus ui.
CRs-Fixed: 712850
Change-Id: If3d51c8ea31f4a755e26fe4730e85428373e6446
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 48458ba0a..ea346c3c6 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -896,17 +896,20 @@ public class PhotoUI implements PieListener, @Override public void onFocusStarted() { - getFocusIndicator().showStart(); + FocusIndicator indicator = getFocusIndicator(); + if (indicator != null) indicator.showStart(); } @Override public void onFocusSucceeded(boolean timeout) { - getFocusIndicator().showSuccess(timeout); + FocusIndicator indicator = getFocusIndicator(); + if (indicator != null) indicator.showSuccess(timeout); } @Override public void onFocusFailed(boolean timeout) { - getFocusIndicator().showFail(timeout); + FocusIndicator indicator = getFocusIndicator(); + if (indicator != null) indicator.showFail(timeout); } @Override |