Add check for "Silent" Uri.EMPTY Ringtone Uri
Currently we do not check for the ringtone Uri Uri.Empty, which is
the "Silent" ringtone. Since we did not check for this case, we would
play a "Dinging" sound instead of nothing when we queried for the
Ringtone associated with the Uri.
This change checks to see if the Ringtone Uri is Uri.EMPTY before
playing it.
Change-Id: Iab51d43184f29caf58f5333a7c893c26cd9bca0a
Fix: 28912183
diff --git a/src/com/android/server/telecom/AsyncRingtonePlayer.java b/src/com/android/server/telecom/AsyncRingtonePlayer.java
index cc8cdcc..d2a7614 100644
--- a/src/com/android/server/telecom/AsyncRingtonePlayer.java
+++ b/src/com/android/server/telecom/AsyncRingtonePlayer.java
@@ -121,6 +121,13 @@
return;
}
+ // If the Ringtone Uri is EMPTY, then the "None" Ringtone has been selected. Do not play
+ // anything.
+ if(Uri.EMPTY.equals(incomingCall.getRingtone())) {
+ mRingtone = null;
+ return;
+ }
+
ThreadUtil.checkNotOnMainThread();
Log.i(this, "Play ringtone.");