summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Newberger <alann@google.com>2015-07-24 18:50:49 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-24 18:50:49 (GMT)
commit2ef8ffd24cec8800467ed2c9192141c1648a47ce (patch)
tree0f7bf661417e27c32872511b58c085c34a44cb0a
parente5f7f8831edf427cf00b17e48d1331e737d71275 (diff)
parentd7a6172bfa8b889a290f6623de53bbf41943a373 (diff)
downloadandroid_packages_apps_Camera2-2ef8ffd24cec8800467ed2c9192141c1648a47ce.zip
android_packages_apps_Camera2-2ef8ffd24cec8800467ed2c9192141c1648a47ce.tar.gz
android_packages_apps_Camera2-2ef8ffd24cec8800467ed2c9192141c1648a47ce.tar.bz2
am d7a6172b: am a5c8a7da: am 151f74fc: am 4df3011e: Protect against destroying uncreated values
* commit 'd7a6172bfa8b889a290f6623de53bbf41943a373': Protect against destroying uncreated values
-rw-r--r--src/com/android/camera/CameraActivity.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 3997705..bf48898 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -2169,16 +2169,26 @@ public class CameraActivity extends QuickActivity
mCameraController.removeCallbackReceiver();
mCameraController.setCameraExceptionHandler(null);
}
- getContentResolver().unregisterContentObserver(mLocalImagesObserver);
- getContentResolver().unregisterContentObserver(mLocalVideosObserver);
+ if (mLocalImagesObserver != null) {
+ getContentResolver().unregisterContentObserver(mLocalImagesObserver);
+ }
+ if (mLocalVideosObserver != null) {
+ getContentResolver().unregisterContentObserver(mLocalVideosObserver);
+ }
getServices().getCaptureSessionManager().removeSessionListener(mSessionListener);
- mCameraAppUI.onDestroy();
- mModeListView.setVisibilityChangedListener(null);
+ if (mCameraAppUI != null) {
+ mCameraAppUI.onDestroy();
+ }
+ if (mModeListView != null) {
+ mModeListView.setVisibilityChangedListener(null);
+ }
mCameraController = null;
mSettingsManager = null;
mOrientationManager = null;
mButtonManager = null;
- mSoundPlayer.release();
+ if (mSoundPlayer != null) {
+ mSoundPlayer.release();
+ }
CameraAgentFactory.recycle(CameraAgentFactory.CameraApi.API_1);
CameraAgentFactory.recycle(CameraAgentFactory.CameraApi.AUTO);
}