Notify connections when the ringer is silenced. am: 6d96252436 am: e664d97104
am: 293cb6c010
* commit '293cb6c0109deaff00a3953862448affd7203c13':
Notify connections when the ringer is silenced.
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 6d6ee29..382f2aa 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -1030,6 +1030,19 @@
}
}
+ /**
+ * 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);
}
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index f7046bc..792eb8b 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -661,6 +661,18 @@
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);
diff --git a/src/com/android/server/telecom/Ringer.java b/src/com/android/server/telecom/Ringer.java
index 0ec2298..da22e98 100644
--- a/src/com/android/server/telecom/Ringer.java
+++ b/src/com/android/server/telecom/Ringer.java
@@ -151,6 +151,10 @@
* 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);
diff --git a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
index 903028c..bdcfb5b 100644
--- a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
+++ b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
@@ -40,6 +40,7 @@
import android.telecom.PhoneAccountHandle;
import android.telecom.StatusHints;
+import java.lang.Override;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -113,6 +114,9 @@
public void disconnect(String callId) throws RemoteException { }
@Override
+ public void silence(String callId) throws RemoteException { }
+
+ @Override
public void hold(String callId) throws RemoteException { }
@Override