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

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

Merge "Add callback for connections to be notified when the ringer is...

Merge "Add callback for connections to be notified when the ringer is silenced." into cw-e-dev am: 52bdf115 am: b241487c
am: 64e41590

* commit '64e41590':
  Add callback for connections to be notified when the ringer is silenced.
parents 48543000 64e41590
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1780,6 +1780,13 @@ public abstract class Connection extends Conferenceable {
     */
    public void onReject(String replyMessage) {}

    /**
     * Notifies the Connection of a request to silence the ringer.
     *
     * @hide
     */
    public void onSilence() {}

    /**
     * Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.
     */
+14 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ public abstract class ConnectionService extends Service {
    private static final int MSG_MERGE_CONFERENCE = 18;
    private static final int MSG_SWAP_CONFERENCE = 19;
    private static final int MSG_REJECT_WITH_MESSAGE = 20;
    private static final int MSG_SILENCE = 21;

    private static Connection sNullConnection;

@@ -174,6 +175,11 @@ public abstract class ConnectionService extends Service {
            mHandler.obtainMessage(MSG_REJECT_WITH_MESSAGE, args).sendToTarget();
        }

        @Override
        public void silence(String callId) {
            mHandler.obtainMessage(MSG_SILENCE, callId).sendToTarget();
        }

        @Override
        public void disconnect(String callId) {
            mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget();
@@ -317,6 +323,9 @@ public abstract class ConnectionService extends Service {
                case MSG_DISCONNECT:
                    disconnect((String) msg.obj);
                    break;
                case MSG_SILENCE:
                    silence((String) msg.obj);
                    break;
                case MSG_HOLD:
                    hold((String) msg.obj);
                    break;
@@ -704,6 +713,11 @@ public abstract class ConnectionService extends Service {
        findConnectionForAction(callId, "reject").onReject(rejectWithMessage);
    }

    private void silence(String callId) {
        Log.d(this, "silence %s", callId);
        findConnectionForAction(callId, "silence").onSilence();
    }

    private void disconnect(String callId) {
        Log.d(this, "disconnect %s", callId);
        if (mConnectionById.containsKey(callId)) {
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ oneway interface IConnectionService {

    void disconnect(String callId);

    void silence(String callId);

    void hold(String callId);

    void unhold(String callId);