audio: Add check to IDevice.close for currently opened streams
IDevice.close must not proceed if there are streams
that are currently opened on this device.
Bug: 114451103
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I61d81bc0333098c341d5d551bf59331e49fcf682
diff --git a/audio/6.0/IDevice.hal b/audio/6.0/IDevice.hal
index 520e776..122c550 100644
--- a/audio/6.0/IDevice.hal
+++ b/audio/6.0/IDevice.hal
@@ -286,8 +286,12 @@
* all currently allocated resources. It is recommended to close
* the device on the client side as soon as it is becomes unused.
*
+ * Note that all streams must be closed by the client before
+ * attempting to close the device they belong to.
+ *
* @return retval OK in case the success.
- * INVALID_STATE if the device was already closed.
+ * INVALID_STATE if the device was already closed
+ * or there are streams currently opened.
*/
@exit
close() generates (Result retval);