audio HAL: fix master-without-vendor build.
Change-Id: I9dc674fc04a0847b4b5947e024ec4b5325b34575
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp
index af9d928..b615443 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -688,7 +688,7 @@
// - the output stream is active
mEcnsEnabled = mEcnsRequested;
if (mOutput->getStandby()) {
- mEcnsEnabled &= ~AudioPostProcessor::AEC;
+ mEcnsEnabled &= ~PREPROC_AEC;
}
#ifdef USE_PROPRIETARY_AUDIO_EXTENSIONS
@@ -697,7 +697,7 @@
if (mEcnsEnabled) {
mHwInRate = ecnsRate;
// rx path is altered only if AEC is enabled
- if (mEcnsEnabled & AudioPostProcessor::AEC) {
+ if (mEcnsEnabled & PREPROC_AEC) {
mHwOutRate = mHwInRate;
} else {
mHwOutRate = AUDIO_HW_OUT_SAMPLERATE;
@@ -1678,7 +1678,7 @@
}
{
Mutex::Autolock dfl(mFdLock);
- ret = ::read(mFd, buffer, hwReadBytes);
+ ret = ::read(mFd, buffer, bytes);
}
#endif
@@ -1730,7 +1730,7 @@
LOGV("input %p going into standby", this);
mState = AUDIO_STREAM_IDLE;
// reset global pre processing state before disabling the input
- mHardware->setEcnsRequested_l(AudioPostProcessor::AEC|AudioPostProcessor::NS, false);
+ mHardware->setEcnsRequested_l(PREPROC_AEC|PREPROC_NS, false);
// setDriver_l() will not try to lock mLock when called by doRouting_l()
mLocked = true;
mHardware->doRouting_l();
@@ -1972,9 +1972,9 @@
if (status == 0) {
int ecns = 0;
if (memcmp(&desc.type, FX_IID_AEC, sizeof(effect_uuid_t)) == 0) {
- ecns = AudioPostProcessor::AEC;
+ ecns = PREPROC_AEC;
} else if (memcmp(&desc.type, FX_IID_NS, sizeof(effect_uuid_t)) == 0) {
- ecns = AudioPostProcessor::NS;
+ ecns = PREPROC_NS;
}
LOGV("AudioStreamInTegra::updateEcnsRequested() %s effect %s",
enabled ? "enabling" : "disabling", desc.name);
diff --git a/libaudio/AudioHardware.h b/libaudio/AudioHardware.h
index c482464..f56d58e 100644
--- a/libaudio/AudioHardware.h
+++ b/libaudio/AudioHardware.h
@@ -137,9 +137,19 @@
// added by AudioHardware
status_t init();
- void setEcnsRequested_l(int ecns, bool enabled);
- bool isEcRequested() { return !!(mEcnsRequested & AudioPostProcessor::AEC); }
+ // voice processing IDs for mEcnsRequested and mEcnsEnabled
+ enum {
+#ifdef USE_PROPRIETARY_AUDIO_EXTENSIONS
+ PREPROC_AEC = AudioPostProcessor::AEC, // AEC is enabled
+ PREPROC_NS = AudioPostProcessor::NS, // NS is enabled
+#else
+ PREPROC_AEC = 0x1, // AEC is enabled
+ PREPROC_NS = 0x2, // NS is enabled
+#endif
+ };
+ void setEcnsRequested_l(int ecns, bool enabled);
+ bool isEcRequested() { return !!(mEcnsRequested & PREPROC_AEC); }
protected:
// AudioHardwareBase provides default implementation
//virtual bool isModeInCall(int mode);