Merge "Audioflinger: reverse logic of BT NREC indication"
This commit is contained in:
@@ -151,7 +151,7 @@ static const char *audio_interfaces[] = {
|
|||||||
AudioFlinger::AudioFlinger()
|
AudioFlinger::AudioFlinger()
|
||||||
: BnAudioFlinger(),
|
: BnAudioFlinger(),
|
||||||
mPrimaryHardwareDev(0), mMasterVolume(1.0f), mMasterMute(false), mNextUniqueId(1),
|
mPrimaryHardwareDev(0), mMasterVolume(1.0f), mMasterMute(false), mNextUniqueId(1),
|
||||||
mBtNrec(false)
|
mBtNrecIsOff(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,15 +751,15 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs)
|
|||||||
String8 value;
|
String8 value;
|
||||||
if (param.get(String8(AUDIO_PARAMETER_KEY_BT_NREC), value) == NO_ERROR) {
|
if (param.get(String8(AUDIO_PARAMETER_KEY_BT_NREC), value) == NO_ERROR) {
|
||||||
Mutex::Autolock _l(mLock);
|
Mutex::Autolock _l(mLock);
|
||||||
bool btNrec = (value == AUDIO_PARAMETER_VALUE_ON);
|
bool btNrecIsOff = (value == AUDIO_PARAMETER_VALUE_OFF);
|
||||||
if (mBtNrec != btNrec) {
|
if (mBtNrecIsOff != btNrecIsOff) {
|
||||||
for (size_t i = 0; i < mRecordThreads.size(); i++) {
|
for (size_t i = 0; i < mRecordThreads.size(); i++) {
|
||||||
sp<RecordThread> thread = mRecordThreads.valueAt(i);
|
sp<RecordThread> thread = mRecordThreads.valueAt(i);
|
||||||
RecordThread::RecordTrack *track = thread->track();
|
RecordThread::RecordTrack *track = thread->track();
|
||||||
if (track != NULL) {
|
if (track != NULL) {
|
||||||
audio_devices_t device = (audio_devices_t)(
|
audio_devices_t device = (audio_devices_t)(
|
||||||
thread->device() & AUDIO_DEVICE_IN_ALL);
|
thread->device() & AUDIO_DEVICE_IN_ALL);
|
||||||
bool suspend = audio_is_bluetooth_sco_device(device) && btNrec;
|
bool suspend = audio_is_bluetooth_sco_device(device) && btNrecIsOff;
|
||||||
thread->setEffectSuspended(FX_IID_AEC,
|
thread->setEffectSuspended(FX_IID_AEC,
|
||||||
suspend,
|
suspend,
|
||||||
track->sessionId());
|
track->sessionId());
|
||||||
@@ -768,7 +768,7 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs)
|
|||||||
track->sessionId());
|
track->sessionId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mBtNrec = btNrec;
|
mBtNrecIsOff = btNrecIsOff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return final_result;
|
return final_result;
|
||||||
@@ -4394,7 +4394,7 @@ sp<AudioFlinger::RecordThread::RecordTrack> AudioFlinger::RecordThread::createR
|
|||||||
mTrack = track.get();
|
mTrack = track.get();
|
||||||
// disable AEC and NS if the device is a BT SCO headset supporting those pre processings
|
// disable AEC and NS if the device is a BT SCO headset supporting those pre processings
|
||||||
bool suspend = audio_is_bluetooth_sco_device(
|
bool suspend = audio_is_bluetooth_sco_device(
|
||||||
(audio_devices_t)(mDevice & AUDIO_DEVICE_IN_ALL)) && mAudioFlinger->btNrec();
|
(audio_devices_t)(mDevice & AUDIO_DEVICE_IN_ALL)) && mAudioFlinger->btNrecIsOff();
|
||||||
setEffectSuspended_l(FX_IID_AEC, suspend, sessionId);
|
setEffectSuspended_l(FX_IID_AEC, suspend, sessionId);
|
||||||
setEffectSuspended_l(FX_IID_NS, suspend, sessionId);
|
setEffectSuspended_l(FX_IID_NS, suspend, sessionId);
|
||||||
}
|
}
|
||||||
@@ -4619,7 +4619,7 @@ bool AudioFlinger::RecordThread::checkForNewParameters_l()
|
|||||||
// disable AEC and NS if the device is a BT SCO headset supporting those pre processings
|
// disable AEC and NS if the device is a BT SCO headset supporting those pre processings
|
||||||
if (mTrack != NULL) {
|
if (mTrack != NULL) {
|
||||||
bool suspend = audio_is_bluetooth_sco_device(
|
bool suspend = audio_is_bluetooth_sco_device(
|
||||||
(audio_devices_t)value) && mAudioFlinger->btNrec();
|
(audio_devices_t)value) && mAudioFlinger->btNrecIsOff();
|
||||||
setEffectSuspended_l(FX_IID_AEC, suspend, mTrack->sessionId());
|
setEffectSuspended_l(FX_IID_AEC, suspend, mTrack->sessionId());
|
||||||
setEffectSuspended_l(FX_IID_NS, suspend, mTrack->sessionId());
|
setEffectSuspended_l(FX_IID_NS, suspend, mTrack->sessionId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ public:
|
|||||||
|
|
||||||
uint32_t getMode() { return mMode; }
|
uint32_t getMode() { return mMode; }
|
||||||
|
|
||||||
bool btNrec() { return mBtNrec; }
|
bool btNrecIsOff() { return mBtNrecIsOff; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioFlinger();
|
AudioFlinger();
|
||||||
@@ -1389,7 +1389,7 @@ private:
|
|||||||
DefaultKeyedVector< pid_t, sp<NotificationClient> > mNotificationClients;
|
DefaultKeyedVector< pid_t, sp<NotificationClient> > mNotificationClients;
|
||||||
volatile int32_t mNextUniqueId;
|
volatile int32_t mNextUniqueId;
|
||||||
uint32_t mMode;
|
uint32_t mMode;
|
||||||
bool mBtNrec;
|
bool mBtNrecIsOff;
|
||||||
|
|
||||||
Vector<AudioSessionRef*> mAudioSessionRefs;
|
Vector<AudioSessionRef*> mAudioSessionRefs;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user