From 8e920568371136b011c79e6c1d15bcb4c047d0a3 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Thu, 26 Jul 2018 13:00:08 +0100 Subject: [PATCH] Camera: Don't hold 'mLock' when closing the camera session After flushing the camera requests don't try to close the camera session while still holding 'mLock'. Different Hals could still try and return additional results which then will get blocked on 'mLock'. Closing the session could potentially introduce a deadlock if the Hal implementation waits for any of the result calls to return. Bug: 111836165 Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check --skip-preconditions --module VtsHalCameraProviderV2_4Target -l INFO Change-Id: I0f309f435cc76db3f9b6ba500da65a232b014717 --- .../vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 1a245c4610..439333d9ca 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -4046,10 +4046,10 @@ TEST_F(CameraHidlTest, flushPreviewRequest) { << static_cast(inflightReq.errorCode); } } - - ret = session->close(); - ASSERT_TRUE(ret.isOk()); } + + ret = session->close(); + ASSERT_TRUE(ret.isOk()); } }