diff options
author | Marco Nelissen <marcone@google.com> | 2013-09-26 12:44:55 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2013-09-26 12:44:55 -0700 |
commit | 19a4671b10e7d07309f1d427e1d81b87d5bbca18 (patch) | |
tree | fac6b8841f7dea91e2100abb8c59e43ebdeb71bf /media | |
parent | fd2e50086c4f4e2bb064c76a1de73e10c172f387 (diff) | |
download | frameworks_base-19a4671b10e7d07309f1d427e1d81b87d5bbca18.zip frameworks_base-19a4671b10e7d07309f1d427e1d81b87d5bbca18.tar.gz frameworks_base-19a4671b10e7d07309f1d427e1d81b87d5bbca18.tar.bz2 |
Fix logic in fallback ringtone handling
The existing code would only play a fallback ringtone if the requested
ringtone was one of the three ringtone uris that are defined by settings,
and it wasn't set to "silent".
Now it also plays the fallback for custom ringtone uris.
b/10891718
Change-Id: I79c2298c6497165e6845b98532cce0855347e50b
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/Ringtone.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/java/android/media/Ringtone.java b/media/java/android/media/Ringtone.java index c335e55..1283e9b 100644 --- a/media/java/android/media/Ringtone.java +++ b/media/java/android/media/Ringtone.java @@ -280,7 +280,7 @@ public class Ringtone { private boolean playFallbackRingtone() { if (mAudioManager.getStreamVolume(mStreamType) != 0) { int ringtoneType = RingtoneManager.getDefaultType(mUri); - if (ringtoneType != -1 && + if (ringtoneType == -1 || RingtoneManager.getActualDefaultRingtoneUri(mContext, ringtoneType) != null) { // Default ringtone, try fallback ringtone. try { @@ -309,6 +309,8 @@ public class Ringtone { } catch (NotFoundException nfe) { Log.e(TAG, "Fallback ringtone does not exist"); } + } else { + Log.w(TAG, "not playing fallback for " + mUri); } } return false; |