Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a20d9e9 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

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
parent 43251208
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -100,8 +100,12 @@ DeviceHalHidl::DeviceHalHidl(const sp<IDevice>& device)

DeviceHalHidl::~DeviceHalHidl() {
    if (mDevice != 0) {
#if MAJOR_VERSION <= 5
        mDevice.clear();
        hardware::IPCThreadState::self()->flushCommands();
#elif MAJOR_VERSION >= 6
        mDevice->close();
#endif
    }
}