summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2017-09-14 12:30:17 -0700
committerChien-Yu Chen <cychen@google.com>2017-09-18 17:36:29 -0700
commit1e830e1db2f5600eeedb8d7ed0a3abcf6770497d (patch)
tree7a00f0824e1d253044ea816cad02809a8e1c0fce
parente0fbe7829eaf94d23619ac8b7528bcdbd74319bd (diff)
downloadeasel-1e830e1db2f5600eeedb8d7ed0a3abcf6770497d.tar.gz
pbcamera: Update API to avoid deadlock
Move the listener to constructor to make sure that it's valid at all time to remove a mutex lock. Test: CTS Bug: 65608467 Change-Id: Ideac9a1dd97984a7d593bd75817c4eeddb304c2a
-rw-r--r--camera/libhdrplusclient/include/HdrPlusClient.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/camera/libhdrplusclient/include/HdrPlusClient.h b/camera/libhdrplusclient/include/HdrPlusClient.h
index 7896c89..40905cc 100644
--- a/camera/libhdrplusclient/include/HdrPlusClient.h
+++ b/camera/libhdrplusclient/include/HdrPlusClient.h
@@ -33,7 +33,9 @@ namespace android {
*/
class HdrPlusClient {
public:
- HdrPlusClient() {};
+ // HdrPlusClientListener is the listener to receive callbacks from HDR+ client. The listener
+ // must be valid during the life cycle of HdrPlusClient
+ HdrPlusClient(HdrPlusClientListener *) {};
/*
* The recommended way to create an HdrPlusClient instance is via
* EaselManagerClient::openHdrPlusClientAsync() or EaselManagerClient::openHdrPlusClientAsync().
@@ -47,17 +49,12 @@ public:
*
* If EaselManagerClient is used to create the HdrPlusClient, it is already connected.
*
- * listener is the listener to receive callbacks from HDR+ client.
- *
* Returns:
* 0: on success.
* -EEXIST: if it's already connected.
* -ENODEV: if connecting failed due to a serious error.
*/
- virtual status_t connect(HdrPlusClientListener *listener) = 0;
-
- // Disconnect from HDR+ service.
- virtual void disconnect() = 0;
+ virtual status_t connect() = 0;
/*
* Set the static metadata of current camera device.