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/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 4af30ae..14a4df7 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -266,7 +266,7 @@
struct audio_port *ports);
/* Get attributes for a given audio port */
- virtual status_t getAudioPort(struct audio_port_v7 *port);
+ virtual status_t getAudioPort(struct audio_port *port);
/* Create an audio patch between several source and sink ports */
virtual status_t createAudioPatch(const struct audio_patch *patch,
diff --git a/services/audioflinger/AudioHwDevice.cpp b/services/audioflinger/AudioHwDevice.cpp
index 16b25f6..dda164c 100644
--- a/services/audioflinger/AudioHwDevice.cpp
+++ b/services/audioflinger/AudioHwDevice.cpp
@@ -98,9 +98,5 @@
return mHwDevice->supportsAudioPatches(&result) == OK ? result : false;
}
-status_t AudioHwDevice::getAudioPort(struct audio_port_v7 *port) const {
- return mHwDevice->getAudioPort(port);
-}
-
}; // namespace android
diff --git a/services/audioflinger/AudioHwDevice.h b/services/audioflinger/AudioHwDevice.h
index fc2c693..6709d17 100644
--- a/services/audioflinger/AudioHwDevice.h
+++ b/services/audioflinger/AudioHwDevice.h
@@ -83,8 +83,6 @@
bool supportsAudioPatches() const;
- status_t getAudioPort(struct audio_port_v7 *port) const;
-
private:
const audio_module_handle_t mHandle;
const char * const mModuleName;
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index f6971fc..b58fd8b 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -55,7 +55,8 @@
}
/* Get supported attributes for a given audio port */
-status_t AudioFlinger::getAudioPort(struct audio_port_v7 *port) {
+status_t AudioFlinger::getAudioPort(struct audio_port *port)
+{
Mutex::Autolock _l(mLock);
return mPatchPanel.getAudioPort(port);
}
@@ -102,18 +103,10 @@
}
/* Get supported attributes for a given audio port */
-status_t AudioFlinger::PatchPanel::getAudioPort(struct audio_port_v7 *port)
+status_t AudioFlinger::PatchPanel::getAudioPort(struct audio_port *port __unused)
{
- if (port->type != AUDIO_PORT_TYPE_DEVICE) {
- // Only query the HAL when the port is a device.
- return NO_ERROR;
- }
- AudioHwDevice* hwDevice = findAudioHwDeviceByModule(port->ext.device.hw_module);
- if (hwDevice == nullptr) {
- ALOGW("%s cannot find hw module %d", __func__, port->ext.device.hw_module);
- return BAD_VALUE;
- }
- return hwDevice->getAudioPort(port);
+ ALOGV(__func__);
+ return NO_ERROR;
}
/* Connect a patch between several source and sink ports */
diff --git a/services/audioflinger/PatchPanel.h b/services/audioflinger/PatchPanel.h
index 2568dd3..89d4eb1 100644
--- a/services/audioflinger/PatchPanel.h
+++ b/services/audioflinger/PatchPanel.h
@@ -52,7 +52,7 @@
struct audio_port *ports);
/* Get supported attributes for a given audio port */
- status_t getAudioPort(struct audio_port_v7 *port);
+ status_t getAudioPort(struct audio_port *port);
/* Create a patch between several source and sink ports */
status_t createAudioPatch(const struct audio_patch *patch,