diff options
Diffstat (limited to 'media/java/android/media/AudioManager.java')
-rw-r--r-- | media/java/android/media/AudioManager.java | 101 |
1 files changed, 100 insertions, 1 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 875e716..fc917f6 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -67,7 +67,6 @@ public class AudioManager { private final boolean mUseFixedVolume; private static String TAG = "AudioManager"; private static final AudioPortEventHandler sAudioPortEventHandler = new AudioPortEventHandler(); - /** * Broadcast intent, a hint for applications that audio is about to become * 'noisy' due to a change in audio outputs. For example, this intent may @@ -310,6 +309,32 @@ public class AudioManager { */ public static final String EXTRA_ENCODINGS = "android.media.extra.ENCODINGS"; + /** + * @hide Broadcast intent when RemoteControlClient list is updated. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String RCC_CHANGED_ACTION = + "org.codeaurora.bluetooth.RCC_CHANGED_ACTION"; + + /** + * @hide Used for sharing the calling package name + */ + public static final String EXTRA_CALLING_PACKAGE_NAME = + "org.codeaurora.bluetooth.EXTRA_CALLING_PACKAGE_NAME"; + + /** + * @hide Used for sharing the focus changed value + */ + public static final String EXTRA_FOCUS_CHANGED_VALUE = + "org.codeaurora.bluetooth.EXTRA_FOCUS_CHANGED_VALUE"; + + /** + * @hide Used for sharing the availability changed value + */ + public static final String EXTRA_AVAILABLITY_CHANGED_VALUE = + "org.codeaurora.bluetooth.EXTRA_AVAILABLITY_CHANGED_VALUE"; + + /** The audio stream for phone calls */ public static final int STREAM_VOICE_CALL = AudioSystem.STREAM_VOICE_CALL; /** The audio stream for system sounds */ @@ -2481,6 +2506,7 @@ public class AudioManager { //==================================================================== // Remote Control + /** * Register a component to be the sole receiver of MEDIA_BUTTON intents. * @param eventReceiver identifier of a {@link android.content.BroadcastReceiver} @@ -2499,6 +2525,7 @@ public class AudioManager { "receiver and context package names don't match"); return; } + // construct a PendingIntent for the media button and register it Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); // the associated intent will be handled by the component being registered @@ -2508,6 +2535,7 @@ public class AudioManager { registerMediaButtonIntent(pi, eventReceiver); } + /** * Register a component to be the sole receiver of MEDIA_BUTTON intents. This is like * {@link #registerMediaButtonEventReceiver(android.content.ComponentName)}, but allows @@ -2637,6 +2665,13 @@ public class AudioManager { return false; } rctlr.startListeningToSessions(); + IAudioService service = getService(); + try { + service.updateRemoteControllerOnExistingMediaPlayers(); + } catch (RemoteException e) { + Log.e(TAG, "Error in calling Audio service interface" + + "updateRemoteControllerOnExistingMediaPlayers() due to " + e); + } return true; } @@ -2660,6 +2695,24 @@ public class AudioManager { /** * @hide + */ + public void updateMediaPlayerList(String packageName, boolean toAdd) { + IAudioService service = getService(); + try { + if (toAdd) { + Log.d(TAG, "updateMediaPlayerList: Add RCC " + packageName + " to List"); + service.addMediaPlayerAndUpdateRemoteController(packageName); + } else { + Log.d(TAG, "updateMediaPlayerList: Remove RCC " + packageName + " from List"); + service.removeMediaPlayerAndUpdateRemoteController(packageName); + } + } catch (RemoteException e) { + Log.e(TAG, "Exception while executing updateMediaPlayerList: " + e); + } + } + + /** + * @hide * Registers a remote control display that will be sent information by remote control clients. * Use this method if your IRemoteControlDisplay is not going to display artwork, otherwise * use {@link #registerRemoteControlDisplay(IRemoteControlDisplay, int, int)} to pass the @@ -2811,6 +2864,52 @@ public class AudioManager { } } + /** + * @hide + * Request the user of a RemoteControlClient to play the requested item. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + * @param uid uid of the song to be played. + * @scope scope of the file system to use + */ + public void setRemoteControlClientPlayItem(long uid, int scope) { + IAudioService service = getService(); + try { + service.setRemoteControlClientPlayItem(uid, scope); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in setRemoteControlClientPlayItem(" + + uid + ", " + scope + ")", e); + } + } + + /** + * @hide + * Request the user of a RemoteControlClient to provide with the now playing list entries. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + */ + public void getRemoteControlClientNowPlayingEntries() { + IAudioService service = getService(); + try { + service.getRemoteControlClientNowPlayingEntries(); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in getRemoteControlClientNowPlayingEntries(" + ")", e); + } + } + + /** + * @hide + * Request the user of a RemoteControlClient to set the music player as current browsed player. + */ + public void setRemoteControlClientBrowsedPlayer() { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer: "); + IAudioService service = getService(); + try { + service.setRemoteControlClientBrowsedPlayer(); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in setRemoteControlClientBrowsedPlayer(" + ")", e); + } + } /** * @hide |