diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-09 22:20:53 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-09 22:20:53 -0800 |
commit | f497f1ea7217f197af6c8c5f981bfb738c147f6a (patch) | |
tree | 2da9103982f85e16fc3218b6e92cb4b6b5bee0cf /src/com/android/camera | |
parent | ca99fb07777edcde4c9159c1567b95a227e916fa (diff) | |
parent | dd6600e7f0adf322e5a8fcb0ed5389b14655106e (diff) | |
download | LegacyCamera-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.java | 9 |
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; } } |