am 86a12d46: am 10e2120b: Merge "Add CallManager/Phone.setEchoSuppressionEnabled()." into gingerbread

Merge commit '86a12d465fca7d25d99a788abda33fde5154a739'

* commit '86a12d465fca7d25d99a788abda33fde5154a739':
  Add CallManager/Phone.setEchoSuppressionEnabled().
This commit is contained in:
Hung-ying Tyan
2010-10-01 17:07:48 -07:00
committed by Android Git Automerger
5 changed files with 46 additions and 0 deletions

View File

@@ -860,6 +860,25 @@ public final class CallManager {
return false;
}
/**
* Enables or disables echo suppression.
*/
public void setEchoSuppressionEnabled(boolean enabled) {
if (VDBG) {
Log.d(LOG_TAG, " setEchoSuppression(" + enabled + ")");
Log.d(LOG_TAG, this.toString());
}
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().setEchoSuppressionEnabled(enabled);
}
if (VDBG) {
Log.d(LOG_TAG, "End setEchoSuppression(" + enabled + ")");
Log.d(LOG_TAG, this.toString());
}
}
/**
* Play a DTMF tone on the active call.
*

View File

@@ -1186,6 +1186,11 @@ public interface Phone {
*/
boolean getMute();
/**
* Enables or disables echo suppression.
*/
void setEchoSuppressionEnabled(boolean enabled);
/**
* Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation.
*

View File

@@ -505,6 +505,10 @@ public abstract class PhoneBase extends Handler implements Phone {
mCM.unregisterForResendIncallMute(h);
}
public void setEchoSuppressionEnabled(boolean enabled) {
// no need for regular phone
}
/**
* Subclasses of Phone probably want to replace this with a
* version scoped to their packages

View File

@@ -578,6 +578,10 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getMute();
}
public void setEchoSuppressionEnabled(boolean enabled) {
mActivePhone.setEchoSuppressionEnabled(enabled);
}
public void invokeOemRilRequestRaw(byte[] data, Message response) {
mActivePhone.invokeOemRilRequestRaw(data, response);
}

View File

@@ -330,6 +330,20 @@ public class SipPhone extends SipPhoneBase {
Log.e(LOG_TAG, "call waiting not supported");
}
@Override
public void setEchoSuppressionEnabled(boolean enabled) {
synchronized (SipPhone.class) {
AudioGroup audioGroup = foregroundCall.getAudioGroup();
if (audioGroup == null) return;
int mode = audioGroup.getMode();
audioGroup.setMode(enabled
? AudioGroup.MODE_ECHO_SUPPRESSION
: AudioGroup.MODE_NORMAL);
Log.d(LOG_TAG, String.format("audioGroup mode change: %d --> %d",
mode, audioGroup.getMode()));
}
}
public void setMute(boolean muted) {
synchronized (SipPhone.class) {
foregroundCall.setMute(muted);