aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2014-08-27 14:39:11 -0700
committerEino-Ville Talvala <etalvala@google.com>2014-08-27 17:19:26 -0700
commit1820b2153fcd3069c89d97d990d3caeeddcdeda2 (patch)
tree618621101f51fa981ee59bba070c51d76518d62c /apps
parent2507052399d987caa46fcb32854886beb0a3443b (diff)
downloadpdk-1820b2153fcd3069c89d97d990d3caeeddcdeda2.tar.gz
TestingCamera2: Minor session cleanup
Main fix is to stop turning off the 'configure' button when a session was closed (making it impossible to create a new session). Also remove session and device states that don't actually exist anymore from their enums, and ignore session closes for old sessions. Bug: 17303361 Change-Id: Ia4483208f18755f2c7f3191ef1a768d85e4b4b4a
Diffstat (limited to 'apps')
-rw-r--r--apps/TestingCamera2/src/com/android/testingcamera2/CameraControlPane.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/apps/TestingCamera2/src/com/android/testingcamera2/CameraControlPane.java b/apps/TestingCamera2/src/com/android/testingcamera2/CameraControlPane.java
index 2318a37..cd4701b 100644
--- a/apps/TestingCamera2/src/com/android/testingcamera2/CameraControlPane.java
+++ b/apps/TestingCamera2/src/com/android/testingcamera2/CameraControlPane.java
@@ -85,10 +85,6 @@ public class CameraControlPane extends ControlPane {
UNAVAILABLE,
CLOSED,
OPENED,
- UNCONFIGURED,
- BUSY,
- IDLE,
- ACTIVE,
DISCONNECTED,
ERROR
}
@@ -100,13 +96,10 @@ public class CameraControlPane extends ControlPane {
*/
private enum SessionState {
NONE,
- CONFIGURING,
CONFIGURED,
CONFIGURE_FAILED,
READY,
- BUSY,
ACTIVE,
- ERROR,
CLOSED
}
@@ -468,6 +461,7 @@ public class CameraControlPane extends ControlPane {
@Override
public void onConfigured(CameraCaptureSession session) {
mCurrentCaptureSession = session;
+ TLog.i("Configuration completed for camera %s.", mCurrentCamera.getId());
setSessionState(SessionState.CONFIGURED);
}
@@ -514,6 +508,10 @@ public class CameraControlPane extends ControlPane {
*/
@Override
public void onClosed(CameraCaptureSession session) {
+ // Ignore closes if the session has been replaced
+ if (mCurrentCaptureSession != null && session != mCurrentCaptureSession) {
+ return;
+ }
setSessionState(SessionState.CLOSED);
}
};
@@ -573,9 +571,8 @@ public class CameraControlPane extends ControlPane {
mActiveCameraCall = CameraCall.NONE;
// fall-through
case CLOSED:
- case ERROR:
enableBaseControls(true);
- enableOpenControls(false);
+ enableOpenControls(true);
enableConfiguredControls(false);
mConfiguredTargetPanes = null;
break;
@@ -585,11 +582,6 @@ public class CameraControlPane extends ControlPane {
enableConfiguredControls(false);
mConfiguredTargetPanes = null;
break;
- case BUSY:
- enableBaseControls(true);
- enableOpenControls(false);
- enableConfiguredControls(false);
- break;
case CONFIGURED:
if (mActiveCameraCall != CameraCall.CONFIGURE) {
throw new AssertionError();