Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86a12d46 authored by Hung-ying Tyan's avatar Hung-ying Tyan Committed by Android Git Automerger
Browse files

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

Merge commit '10e2120b' into gingerbread-plus-aosp

* commit '10e2120b':
  Add CallManager/Phone.setEchoSuppressionEnabled().
parents bbf00cfb 10e2120b
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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.
     *
+5 −0
Original line number Diff line number Diff line
@@ -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.
     *
+4 −0
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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);
    }
+14 −0
Original line number Diff line number Diff line
@@ -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);