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

Commit 97f061bb authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Don't try caching null ringtones.

Bug: 27330629
Change-Id: Id09d10d6f4a3a20782480647c68a5c94ef69e7b3
parent e88e2665
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -663,6 +663,7 @@ public class RingtoneManager {

        // Stream selected ringtone into cache so it's available for playback
        // when CE storage is still locked
        if (ringtoneUri != null) {
            final ContentResolver cr = context.getContentResolver();
            final Uri cacheUri = getCacheForType(type);
            try (InputStream in = cr.openInputStream(ringtoneUri);
@@ -672,6 +673,7 @@ public class RingtoneManager {
                Log.w(TAG, "Failed to cache ringtone: " + e);
            }
        }
    }

    private static String getSettingForType(int type) {
        if ((type & TYPE_RINGTONE) != 0) {