Don't filter ringback requests by CallService
When checking whether we should start ringing, checking the status
of the CallService is not strictly correct because it can lead to
weird situations during handoff.
Bug: 13902624
Change-Id: Id5ee0d4d050deb2f3038f3de8fdd265caa75f7b2
diff --git a/src/com/android/telecomm/RingbackPlayer.java b/src/com/android/telecomm/RingbackPlayer.java
index c3db04d..4bb8ff2 100644
--- a/src/com/android/telecomm/RingbackPlayer.java
+++ b/src/com/android/telecomm/RingbackPlayer.java
@@ -102,6 +102,11 @@
Preconditions.checkState(call.getState() == CallState.DIALING);
ThreadUtil.checkOnMainThread();
+ if (mCall == call) {
+ Log.w(this, "Ignoring duplicate requests to ring for %s.", call);
+ return;
+ }
+
if (mCall != null) {
// We only get here for the foreground call so, there's no reason why there should
// exist a current dialing call.
@@ -141,7 +146,6 @@
private static boolean shouldStartRinging(Call call) {
return call != null
- && call.getState() == CallState.DIALING
- && call.getCallService() != null;
+ && call.getState() == CallState.DIALING;
}
}