diff options
author | Jay Wang <jaywang@codeaurora.org> | 2016-05-24 16:47:15 -0700 |
---|---|---|
committer | Jay Wang <jaywang@codeaurora.org> | 2016-06-01 17:06:20 -0700 |
commit | 15a6600d68847fc9505fe4a89d252469f80deb7a (patch) | |
tree | 1c11753dc552e5680ea0c2113a174f151581dcf7 | |
parent | dba00aac4e44a91bc55b0aabca9f191d03994edf (diff) | |
download | android_packages_apps_Snap-15a6600d68847fc9505fe4a89d252469f80deb7a.tar.gz android_packages_apps_Snap-15a6600d68847fc9505fe4a89d252469f80deb7a.tar.bz2 android_packages_apps_Snap-15a6600d68847fc9505fe4a89d252469f80deb7a.zip |
SnapdragonCamera: Fixed NPE during camera resume
There is a race condition that mMenu is not initialized before
UI thread accessing the object. This can happen if the
initialization of UI thread is completed before camera thread
opens the camera device. Since the camera mMenu instance is
created in the callback of onCameraOpened(), UI thread needs
to check if mMenu is initialized or not before accessing it.
Change-Id: Ic8ffc50b7334714de9a57b22f8229bc0ce868901
CRs-Fixed: 1013999
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 250f265b2..7cb7948ce 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -1068,7 +1068,9 @@ public class PhotoUI implements PieListener, mReviewImage.setVisibility(View.GONE); mOnScreenIndicators.setVisibility(View.VISIBLE); mMenuButton.setVisibility(View.VISIBLE); - mMenu.hideTopMenu(false); + if (mMenu != null) { + mMenu.hideTopMenu(false); + } CameraUtil.fadeOut(mReviewDoneButton); mShutterButton.setVisibility(View.VISIBLE); CameraUtil.fadeOut(mReviewRetakeButton); |