Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,7 @@ LOCAL_SRC_FILES += \ media/java/android/media/IMediaScannerService.aidl \ media/java/android/media/IRemoteControlClient.aidl \ media/java/android/media/IRemoteControlDisplay.aidl \ media/java/android/media/IRingtonePlayer.aidl \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ Loading core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.internal.R; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.AudioManager; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -213,7 +214,7 @@ public class Notification implements Parcelable /** * Use this constant as the value for audioStreamType to request that * the default stream type for notifications be used. Currently the * default stream type is STREAM_RING. * default stream type is {@link AudioManager#STREAM_NOTIFICATION}. */ public static final int STREAM_DEFAULT = -1; Loading core/res/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,11 @@ android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="signature" /> <!-- Allows registration for remote audio playback. @hide --> <permission android:name="android.permission.REMOTE_AUDIO_PLAYBACK" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="signature" /> <!-- =========================================== --> <!-- Permissions associated with telephony state --> <!-- =========================================== --> Loading media/java/android/media/AudioManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -2306,4 +2306,12 @@ public class AudioManager { } } /** {@hide} */ public IRingtonePlayer getRingtonePlayer() { try { return getService().getRingtonePlayer(); } catch (RemoteException e) { return null; } } } media/java/android/media/AudioService.java +14 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media; import static android.Manifest.permission.REMOTE_AUDIO_PLAYBACK; import static android.media.AudioManager.RINGER_MODE_NORMAL; import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; Loading Loading @@ -360,7 +361,6 @@ public class AudioService extends IAudioService.Stub { private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; // mVolumeControlStream is set by VolumePanel to temporarily force the stream type which volume // is controlled by Vol keys. private int mVolumeControlStream = -1; Loading @@ -369,6 +369,8 @@ public class AudioService extends IAudioService.Stub { // server process so in theory it is not necessary to monitor the client death. // However it is good to be ready for future evolutions. private ForceControlStreamClient mForceControlStreamClient = null; // Used to play ringtones outside system_server private volatile IRingtonePlayer mRingtonePlayer; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -4230,6 +4232,17 @@ public class AudioService extends IAudioService.Stub { } } @Override public void setRingtonePlayer(IRingtonePlayer player) { mContext.enforceCallingOrSelfPermission(REMOTE_AUDIO_PLAYBACK, null); mRingtonePlayer = player; } @Override public IRingtonePlayer getRingtonePlayer() { return mRingtonePlayer; } @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); Loading @@ -4238,6 +4251,4 @@ public class AudioService extends IAudioService.Stub { dumpFocusStack(pw); dumpRCStack(pw); } } Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,7 @@ LOCAL_SRC_FILES += \ media/java/android/media/IMediaScannerService.aidl \ media/java/android/media/IRemoteControlClient.aidl \ media/java/android/media/IRemoteControlDisplay.aidl \ media/java/android/media/IRingtonePlayer.aidl \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ Loading
core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.internal.R; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.AudioManager; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -213,7 +214,7 @@ public class Notification implements Parcelable /** * Use this constant as the value for audioStreamType to request that * the default stream type for notifications be used. Currently the * default stream type is STREAM_RING. * default stream type is {@link AudioManager#STREAM_NOTIFICATION}. */ public static final int STREAM_DEFAULT = -1; Loading
core/res/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,11 @@ android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="signature" /> <!-- Allows registration for remote audio playback. @hide --> <permission android:name="android.permission.REMOTE_AUDIO_PLAYBACK" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="signature" /> <!-- =========================================== --> <!-- Permissions associated with telephony state --> <!-- =========================================== --> Loading
media/java/android/media/AudioManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -2306,4 +2306,12 @@ public class AudioManager { } } /** {@hide} */ public IRingtonePlayer getRingtonePlayer() { try { return getService().getRingtonePlayer(); } catch (RemoteException e) { return null; } } }
media/java/android/media/AudioService.java +14 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media; import static android.Manifest.permission.REMOTE_AUDIO_PLAYBACK; import static android.media.AudioManager.RINGER_MODE_NORMAL; import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; Loading Loading @@ -360,7 +361,6 @@ public class AudioService extends IAudioService.Stub { private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; // mVolumeControlStream is set by VolumePanel to temporarily force the stream type which volume // is controlled by Vol keys. private int mVolumeControlStream = -1; Loading @@ -369,6 +369,8 @@ public class AudioService extends IAudioService.Stub { // server process so in theory it is not necessary to monitor the client death. // However it is good to be ready for future evolutions. private ForceControlStreamClient mForceControlStreamClient = null; // Used to play ringtones outside system_server private volatile IRingtonePlayer mRingtonePlayer; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -4230,6 +4232,17 @@ public class AudioService extends IAudioService.Stub { } } @Override public void setRingtonePlayer(IRingtonePlayer player) { mContext.enforceCallingOrSelfPermission(REMOTE_AUDIO_PLAYBACK, null); mRingtonePlayer = player; } @Override public IRingtonePlayer getRingtonePlayer() { return mRingtonePlayer; } @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); Loading @@ -4238,6 +4251,4 @@ public class AudioService extends IAudioService.Stub { dumpFocusStack(pw); dumpRCStack(pw); } }