Simplify EVS HAL and move to "agressive opens"
This adapts the API implementation to allow a duplicate "open" operation
to automatically close any previous connections to the device. This
works around a binder level issue that can cause destructors triggered
by remote clients to be delivered out of order to the server.
This was originally change ag/1969959 on master, but has been
recreated on oc-dev (cherry-picking was broken at the time).
The original master change will be abandoned in favor of this getting
merged down from oc-dev.
Test: Run Vts test (added in following change)
Change-Id: I7b417998e59a4d592fbb91811c4101f39097c5dd
diff --git a/automotive/evs/1.0/IEvsEnumerator.hal b/automotive/evs/1.0/IEvsEnumerator.hal
index 334430b..98d117a 100644
--- a/automotive/evs/1.0/IEvsEnumerator.hal
+++ b/automotive/evs/1.0/IEvsEnumerator.hal
@@ -31,14 +31,14 @@
*/
getCameraList() generates (vec<CameraDesc> cameras);
-
/**
* Get the IEvsCamera associated with a cameraId from a CameraDesc
*
* Given a camera's unique cameraId from ca CameraDesc, returns
- * the ICamera interface assocaited with the specified camera.
- * When done using the camera, it must be returned by calling
- * closeCamera on the ICamera interface.
+ * the ICamera interface associated with the specified camera.
+ * When done using the camera, the caller may release it by calling closeCamera().
+ * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the
+ * resources may not be released right away due to asynchronos behavior in the hardware binder.
*/
openCamera(string cameraId) generates (IEvsCamera carCamera);
@@ -57,6 +57,9 @@
* There can be at most one EVS display object for the system and this function
* requests access to it. If the EVS display is not available or is already in use,
* a null pointer is returned.
+ * When done using the display, the caller may release it by calling closeDisplay().
+ * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the
+ * resources may not be released right away due to asynchronos behavior in the hardware binder.
*/
openDisplay() generates (IEvsDisplay display);
@@ -64,7 +67,7 @@
* Return the specified IEvsDisplay interface as no longer in use
*
* When the IEvsDisplay object is no longer required, it must be released.
- * NOTE: All buffer must have been returned to the display before making this call.
+ * NOTE: All buffers must have been returned to the display before making this call.
*/
closeDisplay(IEvsDisplay display);