diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-09-25 17:22:27 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-09-26 10:49:35 -0700 |
commit | 65c4a2b26cd8776b0927e9b0e07ecf53bd31b627 (patch) | |
tree | 7dbd0b29b66336c738a0c599335ad70bb86ba4a2 /media | |
parent | 5e21bf934b2a71b595deb9856a2044eea4dbce86 (diff) | |
download | frameworks_base-65c4a2b26cd8776b0927e9b0e07ecf53bd31b627.zip frameworks_base-65c4a2b26cd8776b0927e9b0e07ecf53bd31b627.tar.gz frameworks_base-65c4a2b26cd8776b0927e9b0e07ecf53bd31b627.tar.bz2 |
Multi-user ringtone playback.
Change RingtonePlayer to open content:// Uris based on requesting
UserHandle. Grant SystemUI visibility to all emulated storage so
it can play ringtones for apps without READ_EXTERNAL_STORAGE.
Resolve canonical file:// Uris before passing out of source app,
replacing any /emulated_legacy/-style paths with user-specific
variant so they can be opened by SystemUI. Calling for RemoteViews,
Ringtones, and Notifications.
Bug: 7202982
Change-Id: Ibf0eca8df80c1486711144a7b648f464aadfe099
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/IRingtonePlayer.aidl | 3 | ||||
-rw-r--r-- | media/java/android/media/Ringtone.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/media/java/android/media/IRingtonePlayer.aidl b/media/java/android/media/IRingtonePlayer.aidl index 44a0333..0872f1d 100644 --- a/media/java/android/media/IRingtonePlayer.aidl +++ b/media/java/android/media/IRingtonePlayer.aidl @@ -17,6 +17,7 @@ package android.media; import android.net.Uri; +import android.os.UserHandle; /** * @hide @@ -28,6 +29,6 @@ interface IRingtonePlayer { boolean isPlaying(IBinder token); /** Used for Notification sound playback. */ - void playAsync(in Uri uri, boolean looping, int streamType); + void playAsync(in Uri uri, in UserHandle user, boolean looping, int streamType); void stopAsync(); } diff --git a/media/java/android/media/Ringtone.java b/media/java/android/media/Ringtone.java index 23f7b55..f190eb9 100644 --- a/media/java/android/media/Ringtone.java +++ b/media/java/android/media/Ringtone.java @@ -225,8 +225,9 @@ public class Ringtone { mLocalPlayer.start(); } } else if (mAllowRemote) { + final Uri canonicalUri = mUri.getCanonicalUri(); try { - mRemotePlayer.play(mRemoteToken, mUri, mStreamType); + mRemotePlayer.play(mRemoteToken, canonicalUri, mStreamType); } catch (RemoteException e) { Log.w(TAG, "Problem playing ringtone: " + e); } |