summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayant Chowdhary <jchowdhary@google.com>2019-07-23 14:00:40 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-01 00:58:45 +0000
commit4e2906ccd017ccab62f4d3757c228ec683ce9603 (patch)
treee817eeb1ea9e1f1c88d35725d647214926c007ed
parent5e0bc94aead3c81a858af5473d76fd3531a0271d (diff)
downloadplatform_cts-4e2906ccd017ccab62f4d3757c228ec683ce9603.tar.gz
platform_cts-4e2906ccd017ccab62f4d3757c228ec683ce9603.tar.bz2
platform_cts-4e2906ccd017ccab62f4d3757c228ec683ce9603.zip
Revert "cts: testFlashTurnOff should allow FLASH_STATE_PARTIAL while turning flash off."
This reverts commit 508413980737c4ce8ea08e4e40059449aac67b19. Bug: 137901595 Test: runtest -x CaptureRequestTest.java on multiple devices Change-Id: Ibe4cb699841469d4ad86c7b41ff518da014ecbd7 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com> (cherry picked from commit 2f6b09906c06f2d3f8419e23e616429834bea2a2)
-rw-r--r--tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java66
1 files changed, 5 insertions, 61 deletions
diff --git a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
index c8455686095..2dbe8783c2f 100644
--- a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
@@ -1485,67 +1485,11 @@ public class CaptureRequestTest extends Camera2SurfaceViewTestCase {
// TODO: jchowdhary@, b/130323585, this line can be removed.
requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF);
CaptureRequest flashOffRequest = requestBuilder.build();
- int flashModeOffRequests = captureRequestsSynchronized(flashOffRequest, 2, listener,
- mHandler);
- // We check that the Nth frame's capture result has flash state as either PARTIAL / READY
- // and the N+1th frame has its flash state as READY (to take into account flash off ramp
- // time). For devices supporting per frame control, N is the 1st frame passed into
- // captureRequestsSynchronized. No two frames can have their flash state as PARTIAL.
- CaptureResult firstTorchOffResult = null;
- CaptureResult secondTorchOffResult = null;
- String torchOffDebugStr = "Timed out waiting for torch off result";
- if (mStaticInfo.isPerFrameControlSupported()) {
- firstTorchOffResult =
- listener.getCaptureResultForRequest(flashOffRequest, NUM_RESULTS_WAIT_TIMEOUT);
- secondTorchOffResult =
- listener.getCaptureResultForRequest(flashOffRequest, NUM_RESULTS_WAIT_TIMEOUT);
-
- } else {
- CaptureResult maybeFirstNonFiredResult;
- int i = 0;
- while (i < flashModeOffRequests - 1) {
- maybeFirstNonFiredResult = listener.getCaptureResultForRequest(flashOffRequest,
- NUM_RESULTS_WAIT_TIMEOUT);
- i++;
- Integer flashState = maybeFirstNonFiredResult.get(CaptureResult.FLASH_STATE);
- torchOffDebugStr = "Flash not turned off in time";
- if (flashState != CaptureResult.FLASH_STATE_FIRED) {
- firstTorchOffResult = maybeFirstNonFiredResult;
- secondTorchOffResult = listener.getCaptureResultForRequest(flashOffRequest,
- NUM_RESULTS_WAIT_TIMEOUT);
- torchOffDebugStr = "Timed out waiting for torch off result";
- break;
- }
- }
- // The next results should all have their flash state as READY
- for(int j = i + 1 ; j < flashModeOffRequests; j++) {
- CaptureResult expectedReadyResult =
- listener.getCaptureResultForRequest(flashOffRequest,
- NUM_RESULTS_WAIT_TIMEOUT);
- mCollector.expectEquals("Flash state must remain READY after torch is turned off",
- CaptureResult.FLASH_STATE_READY,
- expectedReadyResult.get(CaptureResult.FLASH_STATE));
- }
- }
- mCollector.expectNotEquals("first torch off result: " + torchOffDebugStr, null,
- firstTorchOffResult);
- mCollector.expectNotEquals("second torch off result: " + torchOffDebugStr, null,
- secondTorchOffResult);
- check2TorchOffStates(firstTorchOffResult, secondTorchOffResult);
- }
-
- private void check2TorchOffStates(CaptureResult first, CaptureResult second) {
- Integer flashState = first.get(CaptureResult.FLASH_STATE);
- // The first frame must have its flash state as FLASH_STATE_READY or
- // FLASH_STATE_PARTIAL.
- int [] validStates = new int[] { CaptureRequest.FLASH_STATE_READY,
- CaptureRequest.FLASH_STATE_PARTIAL};
- mCollector.expectContains("Flash state must be either PARTIAL or READY", validStates,
- flashState);
- // The next frame must have its flash state as FLASH_STATE_READY
- flashState = second.get(CaptureResult.FLASH_STATE);
- mCollector.expectEquals("Flash state result must be READY",
- CaptureResult.FLASH_STATE_READY, flashState);
+ mSession.setRepeatingRequest(flashOffRequest, listener, mHandler);
+ waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_TORCH);
+ result = listener.getCaptureResultForRequest(flashOffRequest, NUM_RESULTS_WAIT_TIMEOUT);
+ mCollector.expectEquals("Flash state result must be READY", CaptureResult.FLASH_STATE_READY,
+ result.get(CaptureResult.FLASH_STATE));
}
/**