Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99d46387 authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Modified getCallerInfo to handle silent ringtone (comment added)"

parents 03b56c22 750bb854
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -249,9 +249,17 @@ public class CallerInfo {

                // look for the custom ringtone, create from the string stored
                // in the database.
                // An empty string ("") in the database indicates a silent ringtone,
                // and we set contactRingtoneUri = Uri.EMPTY, so that no ringtone will be played.
                // {null} in the database indicates the default ringtone,
                // and we set contactRingtoneUri = null, so that default ringtone will be played.
                columnIndex = cursor.getColumnIndex(PhoneLookup.CUSTOM_RINGTONE);
                if ((columnIndex != -1) && (cursor.getString(columnIndex) != null)) {
                    if (TextUtils.isEmpty(cursor.getString(columnIndex))) {
                        info.contactRingtoneUri = Uri.EMPTY;
                    } else {
                        info.contactRingtoneUri = Uri.parse(cursor.getString(columnIndex));
                    }
                } else {
                    info.contactRingtoneUri = null;
                }