summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CameraHolder.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index 09b6b55..b85aefb 100644
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -97,7 +97,10 @@ public class CameraHolder {
}
public synchronized void keep() {
- Assert(users == 1);
+ // We allow (users == 0) for the convenience of the calling activity.
+ // The activity may not have a chance to call open() before the user
+ // choose the menu item to switch to another activity.
+ Assert(users == 1 || users == 0);
// Keep the camera instance for 3 seconds.
keepBeforeTime = System.currentTimeMillis() + 3000;
}