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

Commit e664d971 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

Notify connections when the ringer is silenced.

am: 6d962524

* commit '6d962524':
  Notify connections when the ringer is silenced.
parents 5395e29c 6d962524
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -993,6 +993,19 @@ public class Call implements CreateConnectionResponse {
        }
    }

    /**
     * Silences the ringer.
     */
    void silence() {
        if (mConnectionService == null) {
            Log.w(this, "silence() request on a call without a connection service.");
        } else {
            Log.i(this, "Send silence to connection service for call %s", this);
            Log.event(this, Log.Events.STOP_DTMF);
            mConnectionService.silence(this);
        }
    }

    void disconnect() {
        disconnect(false);
    }
+12 −0
Original line number Diff line number Diff line
@@ -709,6 +709,18 @@ final class ConnectionServiceWrapper extends ServiceBinder {
        removeCall(call, new DisconnectCause(DisconnectCause.LOCAL));
    }

    /** @see IConnectionService#silence(String) */
    void silence(Call call) {
        final String callId = mCallIdMapper.getCallId(call);
        if (callId != null && isServiceValid("silence")) {
            try {
                logOutgoing("silence %s", callId);
                mServiceInterface.silence(callId);
            } catch (RemoteException e) {
            }
        }
    }

    /** @see IConnectionService#hold(String) */
    void hold(Call call) {
        final String callId = mCallIdMapper.getCallId(call);
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ final class Ringer extends CallsManagerListenerBase {
     * Silences the ringer for any actively ringing calls.
     */
    void silence() {
        for (Call call : mRingingCalls) {
            call.silence();
        }

        // Remove all calls from the "ringing" set and then update the ringer.
        mRingingCalls.clear();
        updateRinging(null);
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccountHandle;
import android.telecom.StatusHints;

import java.lang.Override;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -112,6 +113,9 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
        @Override
        public void disconnect(String callId) throws RemoteException { }

        @Override
        public void silence(String callId) throws RemoteException { }

        @Override
        public void hold(String callId) throws RemoteException { }