diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-08-21 17:50:51 +0800 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-10-20 22:21:23 +0000 |
commit | e8f977978e395def4bf0ab54502e75c716516195 (patch) | |
tree | 6c7a803c06ae0959c73d3f0740eac71322dfeecd | |
parent | a380db3c10847a99e1613cf1bf265a56ad62368e (diff) | |
download | android_packages_apps_Camera2-e8f977978e395def4bf0ab54502e75c716516195.tar.gz android_packages_apps_Camera2-e8f977978e395def4bf0ab54502e75c716516195.tar.bz2 android_packages_apps_Camera2-e8f977978e395def4bf0ab54502e75c716516195.zip |
Camera2: fix camera crash 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
-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 8727271b3..7212d7a46 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -929,17 +929,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 |