am 476b03b0: Merge "Handle silent ringtone, title without permission." into jb-dev

* commit '476b03b0c0d5cae4d1b114c6f80858d59ba36cad':
  Handle silent ringtone, title without permission.
This commit is contained in:
Jeff Sharkey
2012-05-07 13:46:24 -07:00
committed by Android Git Automerger

View File

@@ -128,13 +128,16 @@ public class Ringtone {
actualTitle); actualTitle);
} }
} else { } else {
try {
if (DrmStore.AUTHORITY.equals(authority)) { if (DrmStore.AUTHORITY.equals(authority)) {
cursor = res.query(uri, DRM_COLUMNS, null, null, null); cursor = res.query(uri, DRM_COLUMNS, null, null, null);
} else if (MediaStore.AUTHORITY.equals(authority)) { } else if (MediaStore.AUTHORITY.equals(authority)) {
cursor = res.query(uri, MEDIA_COLUMNS, null, null, null); cursor = res.query(uri, MEDIA_COLUMNS, null, null, null);
}
} catch (SecurityException e) {
// missing cursor is handled below
} }
try { try {
if (cursor != null && cursor.getCount() == 1) { if (cursor != null && cursor.getCount() == 1) {
cursor.moveToFirst(); cursor.moveToFirst();
@@ -188,12 +191,12 @@ public class Ringtone {
} catch (SecurityException e) { } catch (SecurityException e) {
destroyLocalPlayer(); destroyLocalPlayer();
if (!mAllowRemote) { if (!mAllowRemote) {
throw new IllegalStateException("Remote playback not allowed", e); Log.w(TAG, "Remote playback not allowed: " + e);
} }
} catch (IOException e) { } catch (IOException e) {
destroyLocalPlayer(); destroyLocalPlayer();
if (!mAllowRemote) { 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); Log.w(TAG, "Problem playing ringtone: " + e);
} }
} else { } 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; return false;
} }
} else { } else {
throw new IllegalStateException("Neither local nor remote playback available"); Log.w(TAG, "Neither local nor remote playback available");
return false;
} }
} }