Call getAudioPort to get supported attributes for audio devices.

GetAudioPort API will return the supported attributes for the devices.
Call getAudioPort to get the supported attributes for the audio
devices so that it is no needed to get supported attributes via
getParameters API.

Bug: 160352965
Test: make
Test: atest audiopolicy_tests AudioPlaybackCaptureTest
Change-Id: Icdfe76e15066bbff10308d6dfd1cf742da33fec9
diff --git a/media/libaudiofoundation/AudioProfile.cpp b/media/libaudiofoundation/AudioProfile.cpp
index 67b600e..ec52575 100644
--- a/media/libaudiofoundation/AudioProfile.cpp
+++ b/media/libaudiofoundation/AudioProfile.cpp
@@ -260,6 +260,16 @@
     return false;
 }
 
+bool AudioProfileVector::contains(const sp<AudioProfile>& profile) const
+{
+    for (const auto& audioProfile : *this) {
+        if (audioProfile->equals(profile)) {
+            return true;
+        }
+    }
+    return false;
+}
+
 void AudioProfileVector::dump(std::string *dst, int spaces) const
 {
     dst->append(base::StringPrintf("%*s- Profiles:\n", spaces, ""));