Fix AudioSystem::getAudioPort implementation

The implementation used to try to convert the complete provided
audio port into AIDL before passing to AP Service. The
corresponding AP Service method has been changed to only take
the port ID—the only piece of information which is actually
used by APM.

Bug: 221075345
Test: in preparation by a contractor
Change-Id: Id274ee14a8bfd2dcbfbb22b7a09b89dc6b7314ce
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index 32c77c7..4c2284b 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -1497,13 +1497,12 @@
     if (port == nullptr) {
         return BAD_VALUE;
     }
-
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
 
-    media::AudioPort portAidl = VALUE_OR_RETURN_STATUS(legacy2aidl_audio_port_v7_AudioPort(*port));
+    media::AudioPort portAidl;
     RETURN_STATUS_IF_ERROR(
-            statusTFromBinderStatus(aps->getAudioPort(portAidl, &portAidl)));
+            statusTFromBinderStatus(aps->getAudioPort(port->id, &portAidl)));
     *port = VALUE_OR_RETURN_STATUS(aidl2legacy_AudioPort_audio_port_v7(portAidl));
     return OK;
 }