Merge "Add CallManager/Phone.setEchoSuppressionEnabled()." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
10e2120bdd
@@ -860,6 +860,25 @@ public final class CallManager {
|
|||||||
return false;
|
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.
|
* Play a DTMF tone on the active call.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1168,6 +1168,11 @@ public interface Phone {
|
|||||||
*/
|
*/
|
||||||
boolean getMute();
|
boolean getMute();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables or disables echo suppression.
|
||||||
|
*/
|
||||||
|
void setEchoSuppressionEnabled(boolean enabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation.
|
* Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -505,6 +505,10 @@ public abstract class PhoneBase extends Handler implements Phone {
|
|||||||
mCM.unregisterForResendIncallMute(h);
|
mCM.unregisterForResendIncallMute(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEchoSuppressionEnabled(boolean enabled) {
|
||||||
|
// no need for regular phone
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subclasses of Phone probably want to replace this with a
|
* Subclasses of Phone probably want to replace this with a
|
||||||
* version scoped to their packages
|
* version scoped to their packages
|
||||||
|
|||||||
@@ -568,6 +568,10 @@ public class PhoneProxy extends Handler implements Phone {
|
|||||||
return mActivePhone.getMute();
|
return mActivePhone.getMute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEchoSuppressionEnabled(boolean enabled) {
|
||||||
|
mActivePhone.setEchoSuppressionEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
public void invokeOemRilRequestRaw(byte[] data, Message response) {
|
public void invokeOemRilRequestRaw(byte[] data, Message response) {
|
||||||
mActivePhone.invokeOemRilRequestRaw(data, response);
|
mActivePhone.invokeOemRilRequestRaw(data, response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,6 +327,20 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
Log.e(LOG_TAG, "call waiting not supported");
|
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) {
|
public void setMute(boolean muted) {
|
||||||
synchronized (SipPhone.class) {
|
synchronized (SipPhone.class) {
|
||||||
foregroundCall.setMute(muted);
|
foregroundCall.setMute(muted);
|
||||||
|
|||||||
Reference in New Issue
Block a user