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

am: 0ca7de9031

* commit '0ca7de90310034d118f21343a69a38ebc02dd0bc':
  Add callback for connections to be notified when the ringer is silenced.
This commit is contained in:
Bryce Lee
2015-11-30 19:17:53 +00:00
committed by android-build-merger
3 changed files with 23 additions and 0 deletions

View File

@@ -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;
@@ -176,6 +177,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();
@@ -319,6 +325,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;
@@ -708,6 +717,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)) {