Revert "Call getAudioPort to get supported attributes for audio devices."

This reverts commit 3b4270ecbebad2b5c0d6733eee3fb52e1ddb76aa.

Reason for revert: b/172307055

Change-Id: Ic22dad674bbd9eee9d3b24308e2a2e964c6406f2
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 207c8cb..d9a5fa2 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -4860,15 +4860,7 @@
     }
 
     if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
-        // first call getAudioPort to get the supported attributes from the HAL
-        struct audio_port_v7 port = {};
-        device->toAudioPort(&port);
-        status_t status = mpClientInterface->getAudioPort(&port);
-        if (status == NO_ERROR) {
-            device->importAudioPort(port);
-        }
-
-        // then list already open outputs that can be routed to this device
+        // first list already open outputs that can be routed to this device
         for (size_t i = 0; i < mOutputs.size(); i++) {
             desc = mOutputs.valueAt(i);
             if (!desc->isDuplicated() && desc->supportsDevice(device)
@@ -4930,8 +4922,8 @@
                   deviceType, address.string(), profile.get(), profile->getName().c_str());
             desc = new SwAudioOutputDescriptor(profile, mpClientInterface);
             audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
-            status = desc->open(nullptr, DeviceVector(device),
-                                AUDIO_STREAM_DEFAULT, AUDIO_OUTPUT_FLAG_NONE, &output);
+            status_t status = desc->open(nullptr, DeviceVector(device),
+                                         AUDIO_STREAM_DEFAULT, AUDIO_OUTPUT_FLAG_NONE, &output);
 
             if (status == NO_ERROR) {
                 // Here is where the out_set_parameters() for card & device gets called
@@ -4955,8 +4947,9 @@
                     config.offload_info.channel_mask = config.channel_mask;
                     config.offload_info.format = config.format;
 
-                    status = desc->open(&config, DeviceVector(device),
-                                        AUDIO_STREAM_DEFAULT, AUDIO_OUTPUT_FLAG_NONE, &output);
+                    status_t status = desc->open(&config, DeviceVector(device),
+                                                 AUDIO_STREAM_DEFAULT,
+                                                 AUDIO_OUTPUT_FLAG_NONE, &output);
                     if (status != NO_ERROR) {
                         output = AUDIO_IO_HANDLE_NONE;
                     }
@@ -4986,8 +4979,8 @@
                         // open a duplicating output thread for the new output and the primary output
                         sp<SwAudioOutputDescriptor> dupOutputDesc =
                                 new SwAudioOutputDescriptor(NULL, mpClientInterface);
-                        status = dupOutputDesc->openDuplicating(mPrimaryOutput, desc,
-                                                                &duplicatedOutput);
+                        status_t status = dupOutputDesc->openDuplicating(mPrimaryOutput, desc,
+                                                                         &duplicatedOutput);
                         if (status == NO_ERROR) {
                             // add duplicated output descriptor
                             addOutput(duplicatedOutput, dupOutputDesc);