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

Commit 750bb854 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Modified getCallerInfo to handle silent ringtone (comment added)

Bug: 12800232
Change-Id: Ib382acdffe39ec063825ae79f80352a5e5636bc4
parent d063fd61
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;
                }