diff options
author | Paul Rohde <codelogic@google.com> | 2015-04-30 11:08:23 -0700 |
---|---|---|
committer | Paul Rohde <codelogic@google.com> | 2015-05-01 14:59:29 -0700 |
commit | 2914f845c1d53f4a3b9aac68998b521290a7192c (patch) | |
tree | 13120370c6186fccf7698d6b9950bae1ed5339ea /src/com/android/camera/CameraActivity.java | |
parent | 1fe3cb806057878c136866871a8a26f76b282560 (diff) | |
download | android_packages_apps_Camera2-2914f845c1d53f4a3b9aac68998b521290a7192c.tar.gz android_packages_apps_Camera2-2914f845c1d53f4a3b9aac68998b521290a7192c.tar.bz2 android_packages_apps_Camera2-2914f845c1d53f4a3b9aac68998b521290a7192c.zip |
Check for a potentially destroyed activity before startPreview.
There is a small chance that the activity can be destroyed
between the time the camera is created and the preview is started.
This can lead to unchecked NPE's across the app because most code
assumes that there will never be a case where activity objects
are accessed after onDestroy.
Bug: 20097425
Change-Id: I2904ffba451ded2417a806c83fd12e4f62611150
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 0b65b3e8d..024cce343 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -2076,6 +2076,9 @@ public class CameraActivity extends QuickActivity unregisterReceiver(mShutdownReceiver); } + // Ensure anything that checks for "isPaused" returns true. + mPaused = true; + mSettingsManager.removeAllListeners(); mCameraController.removeCallbackReceiver(); mCameraController.setCameraExceptionHandler(null); |