commit | 5a20d9e97f3845da46e726c4ed53a4d470004ebf | [log] [tgz] |
---|---|---|
author | Mikhail Naganov <mnaganov@google.com> | Wed Nov 20 14:20:01 2019 -0800 |
committer | Mikhail Naganov <mnaganov@google.com> | Thu Nov 21 10:59:07 2019 -0800 |
tree | ae4638dd5bd56ab53130b6ab337cf36a7c1d437c | |
parent | 43251208e388077681869d639d6d9210e277460d [diff] |
libaudiohal: Call IDevice.close in HAL V6 Call IDevice.close when the client doesn't need the device. Bug: 114451103 Test: adb shell stop Change-Id: I486db716be59cd4ea0f6d75d0e366f802ee9b06d Merged-In: I486db716be59cd4ea0f6d75d0e366f802ee9b06d
diff --git a/media/libaudiohal/impl/DeviceHalHidl.cpp b/media/libaudiohal/impl/DeviceHalHidl.cpp index b25f82e..1b648c9 100644 --- a/media/libaudiohal/impl/DeviceHalHidl.cpp +++ b/media/libaudiohal/impl/DeviceHalHidl.cpp
@@ -100,8 +100,12 @@ DeviceHalHidl::~DeviceHalHidl() { if (mDevice != 0) { +#if MAJOR_VERSION <= 5 mDevice.clear(); hardware::IPCThreadState::self()->flushCommands(); +#elif MAJOR_VERSION >= 6 + mDevice->close(); +#endif } }