summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jean-Michel Trivi <jmtrivi@google.com> 2017-05-26 18:13:38 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-26 18:13:38 +0000
commita4f967471b49fff46140c85ebe44a8736463de02 (patch)
treeb4b099dbb3fd8256da98374afed804afd6eb6aa0
parent9a343a3099f7a5e80940844e2a45c75531c848d7 (diff)
parentfaa2cdfa474eba8415d75deb7fa3e69a9beb478e (diff)
Merge "Playback activity monitoring: add player types" into oc-dev
am: faa2cdfa47 Change-Id: Ic22415e166e94e9a1d3301557b8fe36afce9d29f
-rw-r--r--media/java/android/media/AudioPlaybackConfiguration.java61
1 files changed, 49 insertions, 12 deletions
diff --git a/media/java/android/media/AudioPlaybackConfiguration.java b/media/java/android/media/AudioPlaybackConfiguration.java
index 6b8a2797ad52..14bc5551ba49 100644
--- a/media/java/android/media/AudioPlaybackConfiguration.java
+++ b/media/java/android/media/AudioPlaybackConfiguration.java
@@ -36,14 +36,14 @@ import java.util.Objects;
* session.
*/
public final class AudioPlaybackConfiguration implements Parcelable {
- private final static String TAG = new String("AudioPlaybackConfiguration");
+ private static final String TAG = new String("AudioPlaybackConfiguration");
- private final static boolean DEBUG = false;
+ private static final boolean DEBUG = false;
/** @hide */
- public final static int PLAYER_PIID_INVALID = -1;
+ public static final int PLAYER_PIID_INVALID = -1;
/** @hide */
- public final static int PLAYER_UPID_INVALID = -1;
+ public static final int PLAYER_UPID_INVALID = -1;
// information about the implementation
/**
@@ -51,37 +51,62 @@ public final class AudioPlaybackConfiguration implements Parcelable {
* An unknown type of player
*/
@SystemApi
- public final static int PLAYER_TYPE_UNKNOWN = -1;
+ public static final int PLAYER_TYPE_UNKNOWN = -1;
/**
* @hide
* Player backed by a java android.media.AudioTrack player
*/
@SystemApi
- public final static int PLAYER_TYPE_JAM_AUDIOTRACK = 1;
+ public static final int PLAYER_TYPE_JAM_AUDIOTRACK = 1;
/**
* @hide
* Player backed by a java android.media.MediaPlayer player
*/
@SystemApi
- public final static int PLAYER_TYPE_JAM_MEDIAPLAYER = 2;
+ public static final int PLAYER_TYPE_JAM_MEDIAPLAYER = 2;
/**
* @hide
* Player backed by a java android.media.SoundPool player
*/
@SystemApi
- public final static int PLAYER_TYPE_JAM_SOUNDPOOL = 3;
+ public static final int PLAYER_TYPE_JAM_SOUNDPOOL = 3;
/**
* @hide
* Player backed by a C OpenSL ES AudioPlayer player with a BufferQueue source
*/
@SystemApi
- public final static int PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11;
+ public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11;
/**
* @hide
* Player backed by a C OpenSL ES AudioPlayer player with a URI or FD source
*/
@SystemApi
- public final static int PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12;
+ public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12;
+
+ /**
+ * @hide
+ * Player backed an AAudio player.
+ * Note this type is not in System API so it will not be returned in public API calls
+ */
+ // TODO unhide for SystemApi, update getPlayerType()
+ public static final int PLAYER_TYPE_AAUDIO = 13;
+
+ /**
+ * @hide
+ * Player backed a hardware source, whose state is visible in the Android audio policy manager.
+ * Note this type is not in System API so it will not be returned in public API calls
+ */
+ // TODO unhide for SystemApi, update getPlayerType()
+ public static final int PLAYER_TYPE_HW_SOURCE = 14;
+
+ /**
+ * @hide
+ * Player is a proxy for an audio player whose audio and state doesn't go through the Android
+ * audio framework.
+ * Note this type is not in System API so it will not be returned in public API calls
+ */
+ // TODO unhide for SystemApi, update getPlayerType()
+ public static final int PLAYER_TYPE_EXTERNAL_PROXY = 15;
/** @hide */
@IntDef({
@@ -251,11 +276,20 @@ public final class AudioPlaybackConfiguration implements Parcelable {
* {@link #PLAYER_TYPE_JAM_AUDIOTRACK}, {@link #PLAYER_TYPE_JAM_MEDIAPLAYER},
* {@link #PLAYER_TYPE_JAM_SOUNDPOOL}, {@link #PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE},
* {@link #PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD}, or {@link #PLAYER_TYPE_UNKNOWN}.
+ * <br>Note that player types not exposed in the system API will be represented as
+ * {@link #PLAYER_TYPE_UNKNOWN}.
* @return the type of the player.
*/
@SystemApi
public @PlayerType int getPlayerType() {
- return mPlayerType;
+ switch (mPlayerType) {
+ case PLAYER_TYPE_AAUDIO:
+ case PLAYER_TYPE_HW_SOURCE:
+ case PLAYER_TYPE_EXTERNAL_PROXY:
+ return PLAYER_TYPE_UNKNOWN;
+ default:
+ return mPlayerType;
+ }
}
/**
@@ -442,7 +476,7 @@ public final class AudioPlaybackConfiguration implements Parcelable {
//=====================================================================
// Inner class for corresponding IPlayer and its death monitoring
- final static class IPlayerShell implements IBinder.DeathRecipient {
+ static final class IPlayerShell implements IBinder.DeathRecipient {
final AudioPlaybackConfiguration mMonitor; // never null
private IPlayer mIPlayer;
@@ -494,6 +528,9 @@ public final class AudioPlaybackConfiguration implements Parcelable {
return "OpenSL ES AudioPlayer (Buffer Queue)";
case PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD:
return "OpenSL ES AudioPlayer (URI/FD)";
+ case PLAYER_TYPE_AAUDIO: return "AAudio";
+ case PLAYER_TYPE_HW_SOURCE: return "hardware source";
+ case PLAYER_TYPE_EXTERNAL_PROXY: return "external proxy";
default:
return "unknown player type - FIXME";
}