summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2013-01-22 13:05:34 -0800
committerGeorge Mount <mount@google.com>2013-01-22 14:42:16 -0800
commitda5b9aba75146a33248af3f0ecea6fd85b3e1f50 (patch)
treed6a1dd90df378774dd03f73c17f7d8c79f54b758
parent767f3d45cbc4e5f7441803f8887c6c48dc555e01 (diff)
downloadCamera-da5b9aba75146a33248af3f0ecea6fd85b3e1f50.tar.gz
Prevent call to getSurfaceTexture after startPreview() is canceled.
Bug 7990250 Change-Id: Ic57192e88eb4418d98d04fcf1dde101a05ef69c3
-rw-r--r--src/com/android/camera/PhotoModule.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 6f88b6aa..9e907f66 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -312,6 +312,10 @@ public class PhotoModule
interrupt();
}
+ public boolean isCanceled() {
+ return mCancelled;
+ }
+
@Override
public void run() {
try {
@@ -2118,6 +2122,10 @@ public class PhotoModule
screenNail.enableAspectRatioClamping();
mActivity.notifyScreenNailChanged();
screenNail.acquireSurfaceTexture();
+ CameraStartUpThread t = mCameraStartUpThread;
+ if (t != null && t.isCanceled()) {
+ return; // Exiting, so no need to get the surface texture.
+ }
mSurfaceTexture = screenNail.getSurfaceTexture();
}
mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation);