Merge "Use the incoming call's user to get the ringtone." into udc-dev
diff --git a/src/com/android/server/telecom/RingtoneFactory.java b/src/com/android/server/telecom/RingtoneFactory.java
index f438ff8..309c86e 100644
--- a/src/com/android/server/telecom/RingtoneFactory.java
+++ b/src/com/android/server/telecom/RingtoneFactory.java
@@ -72,9 +72,10 @@
AudioAttributes audioAttrs = getDefaultRingtoneAudioAttributes(hapticChannelsMuted);
// Use the default ringtone of the work profile if the contact is a work profile contact.
+ // or the default ringtone of the receiving user.
Context userContext = isWorkContact(incomingCall) ?
getWorkProfileContextForUser(mCallsManager.getCurrentUserHandle()) :
- getContextForUserHandle(mCallsManager.getCurrentUserHandle());
+ getContextForUserHandle(incomingCall.getUserHandleFromTargetPhoneAccount());
Uri ringtoneUri = incomingCall.getRingtone();
Ringtone ringtone = null;