From 8171de4a43537b3165914fa9b6764b8c3092c30f Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Mon, 7 Dec 2020 10:41:39 -0800 Subject: [PATCH] AAudio player type. AAudio API as a recognized player type. Bug: 170588492 Test: atest AudioPlaybackConfigurationTest Change-Id: I8118829af381573ce65bd56b09628a4114da09fa --- core/api/system-current.txt | 1 + media/java/android/media/AudioPlaybackConfiguration.java | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index d8c18f3bc41eb..120959eeb1efe 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -4350,6 +4350,7 @@ package android.media { field public static final int PLAYER_STATE_STARTED = 2; // 0x2 field public static final int PLAYER_STATE_STOPPED = 4; // 0x4 field public static final int PLAYER_STATE_UNKNOWN = -1; // 0xffffffff + field public static final int PLAYER_TYPE_AAUDIO = 13; // 0xd field public static final int PLAYER_TYPE_JAM_AUDIOTRACK = 1; // 0x1 field public static final int PLAYER_TYPE_JAM_MEDIAPLAYER = 2; // 0x2 field public static final int PLAYER_TYPE_JAM_SOUNDPOOL = 3; // 0x3 diff --git a/media/java/android/media/AudioPlaybackConfiguration.java b/media/java/android/media/AudioPlaybackConfiguration.java index 515e9d0d4c5cc..17305a501cd0f 100644 --- a/media/java/android/media/AudioPlaybackConfiguration.java +++ b/media/java/android/media/AudioPlaybackConfiguration.java @@ -89,9 +89,8 @@ public final class AudioPlaybackConfiguration implements Parcelable { /** * @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() + @SystemApi public static final int PLAYER_TYPE_AAUDIO = 13; /** @@ -280,10 +279,7 @@ public final class AudioPlaybackConfiguration implements Parcelable { /** * @hide - * Return the type of player linked to this configuration. The return value is one of - * {@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}. + * Return the type of player linked to this configuration. *
Note that player types not exposed in the system API will be represented as * {@link #PLAYER_TYPE_UNKNOWN}. * @return the type of the player. @@ -291,7 +287,6 @@ public final class AudioPlaybackConfiguration implements Parcelable { @SystemApi public @PlayerType int getPlayerType() { switch (mPlayerType) { - case PLAYER_TYPE_AAUDIO: case PLAYER_TYPE_HW_SOURCE: case PLAYER_TYPE_EXTERNAL_PROXY: return PLAYER_TYPE_UNKNOWN;