summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Newberger <alann@google.com>2015-07-24 18:33:31 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-24 18:33:31 (GMT)
commitd7a6172bfa8b889a290f6623de53bbf41943a373 (patch)
tree770d60f46b0a734398365191c68b026fe5c2076e
parent471cd0b4dc45863b708db99596394ee9b080b755 (diff)
parenta5c8a7daefe8fadb37ec4f5508eb458a52582013 (diff)
downloadandroid_packages_apps_Camera2-d7a6172bfa8b889a290f6623de53bbf41943a373.zip
android_packages_apps_Camera2-d7a6172bfa8b889a290f6623de53bbf41943a373.tar.gz
android_packages_apps_Camera2-d7a6172bfa8b889a290f6623de53bbf41943a373.tar.bz2
am a5c8a7da: am 151f74fc: am 4df3011e: Protect against destroying uncreated values
* commit 'a5c8a7daefe8fadb37ec4f5508eb458a52582013': 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);
}