summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-09 22:20:53 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-09 22:20:53 -0800
commitf497f1ea7217f197af6c8c5f981bfb738c147f6a (patch)
tree2da9103982f85e16fc3218b6e92cb4b6b5bee0cf /src/com/android/camera
parentca99fb07777edcde4c9159c1567b95a227e916fa (diff)
parentdd6600e7f0adf322e5a8fcb0ed5389b14655106e (diff)
downloadLegacyCamera-f497f1ea7217f197af6c8c5f981bfb738c147f6a.zip
LegacyCamera-f497f1ea7217f197af6c8c5f981bfb738c147f6a.tar.gz
LegacyCamera-f497f1ea7217f197af6c8c5f981bfb738c147f6a.tar.bz2
Merge change I85381f1e into eclair-mr2
* changes: Add a check for the case that the camera is reopened again.
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/CameraHolder.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index 18abd15..a4c1537 100644
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -73,7 +73,14 @@ public class CameraHolder {
public void handleMessage(Message msg) {
switch(msg.what) {
case RELEASE_CAMERA:
- releaseCamera();
+ synchronized (CameraHolder.this) {
+ // In 'CameraHolder.open', the 'RELEASE_CAMERA' message
+ // will be removed if it is found in the queue. However,
+ // there is a chance that this message has been handled
+ // before being removed. So, we need to add a check
+ // here:
+ if (CameraHolder.this.mUsers == 0) releaseCamera();
+ }
break;
}
}