From 65c4a2b26cd8776b0927e9b0e07ecf53bd31b627 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 25 Sep 2012 17:22:27 -0700 Subject: 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 --- media/java/android/media/IRingtonePlayer.aidl | 3 ++- media/java/android/media/Ringtone.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'media/java') 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); } -- cgit v1.1