libaudiohal@aidl: Handle postponed streams closing

Since APM disconnects external devices independently
of AF closing HAL streams, a situation can occur when
APM is trying to disconnect a device port for which
streams still exist. To accommodate this case, allow
postponing of external device disconnection until
the corresponding stream was closed.

Bug: 298175108
Test: atest audiosystem_tests
Change-Id: Ia786822b9b57e4140f75b88b802399975e42b93c
2 files changed