Merge "Add CallManager/Phone.setEchoSuppressionEnabled()." into gingerbread

This commit is contained in:
Hung-ying Tyan
2010-10-01 14:52:00 -07:00
committed by Android (Google) Code Review
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

@@ -1168,6 +1168,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

@@ -568,6 +568,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

@@ -327,6 +327,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);