Add MSD support in getDirectProfilesForAttributes
Enabled an AudioProfile equality comparison that
can ignore the dynamic flags.
Add unit tests for the MSD cases.
Bug: 214971780
Test: atest audiopolicy_tests
Test: atest android.media.audio.cts.DirectAudioProfilesForAttributesTest
Change-Id: Ic72048c9d134c02a79678b8b41f1fb1201ae7086
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index a145c70..587dd60 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -909,6 +909,7 @@
PatchBuilder buildMsdPatch(bool msdIsSource, const sp<DeviceDescriptor> &device) const;
status_t setMsdOutputPatches(const DeviceVector *outputDevices = nullptr);
void releaseMsdOutputPatches(const DeviceVector& devices);
+ bool msdHasPatchesToAllDevices(const AudioDeviceTypeAddrVector& devices);
// Overload of setDeviceConnectionState()
status_t setDeviceConnectionState(audio_devices_t deviceType,
@@ -1120,6 +1121,10 @@
bool isOffloadPossible(const audio_offload_info_t& offloadInfo,
bool durationIgnored = false);
+ // adds the profiles from the outputProfile to the passed audioProfilesVector
+ // without duplicating them if already present
+ void addPortProfilesToVector(sp<IOProfile> outputProfile,
+ AudioProfileVector& audioProfilesVector);
};
};