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

Commit 476b03b0 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Handle silent ringtone, title without permission." into jb-dev

parents 2321301f 1d8e5c58
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -128,12 +128,15 @@ public class Ringtone {
                                    actualTitle);
                }
            } else {
                
                try {
                    if (DrmStore.AUTHORITY.equals(authority)) {
                        cursor = res.query(uri, DRM_COLUMNS, null, null, null);
                    } else if (MediaStore.AUTHORITY.equals(authority)) {
                        cursor = res.query(uri, MEDIA_COLUMNS, null, null, null);
                    }
                } catch (SecurityException e) {
                    // missing cursor is handled below
                }

                try {
                    if (cursor != null && cursor.getCount() == 1) {
@@ -188,12 +191,12 @@ public class Ringtone {
        } catch (SecurityException e) {
            destroyLocalPlayer();
            if (!mAllowRemote) {
                throw new IllegalStateException("Remote playback not allowed", e);
                Log.w(TAG, "Remote playback not allowed: " + e);
            }
        } catch (IOException e) {
            destroyLocalPlayer();
            if (!mAllowRemote) {
                throw new IllegalStateException("Remote playback not allowed", e);
                Log.w(TAG, "Remote playback not allowed: " + e);
            }
        }

@@ -228,7 +231,7 @@ public class Ringtone {
                Log.w(TAG, "Problem playing ringtone: " + e);
            }
        } else {
            throw new IllegalStateException("Neither local nor remote playback available");
            Log.w(TAG, "Neither local nor remote playback available");
        }
    }

@@ -271,7 +274,8 @@ public class Ringtone {
                return false;
            }
        } else {
            throw new IllegalStateException("Neither local nor remote playback available");
            Log.w(TAG, "Neither local nor remote playback available");
            return false;
        }
    }