diff options
| -rw-r--r-- | api/test-current.txt | 7 | ||||
| -rw-r--r-- | media/java/android/media/AudioSystem.java | 475 |
2 files changed, 342 insertions, 140 deletions
diff --git a/api/test-current.txt b/api/test-current.txt index 03f4dc5d2f87..e289284c5cd6 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1504,6 +1504,13 @@ package android.media { ctor public AudioRecordingConfiguration(int, int, int, android.media.AudioFormat, android.media.AudioFormat, int, String); } + public class AudioSystem { + method public static float getMasterBalance(); + method public static final int getNumStreamTypes(); + method public static int setMasterBalance(float); + field public static final int STREAM_DEFAULT = -1; // 0xffffffff + } + public static final class AudioTrack.MetricsConstants { field public static final String ATTRIBUTES = "android.media.audiotrack.attributes"; field public static final String CHANNEL_MASK = "android.media.audiotrack.channelMask"; diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java index 155eb1cfbd46..c11762bcdb40 100644 --- a/media/java/android/media/AudioSystem.java +++ b/media/java/android/media/AudioSystem.java @@ -44,46 +44,56 @@ import java.util.Set; /** * @hide */ +@TestApi public class AudioSystem { private static final boolean DEBUG_VOLUME = false; private static final String TAG = "AudioSystem"; + + // private constructor to prevent instantiating AudioSystem + private AudioSystem() { + throw new UnsupportedOperationException("Trying to instantiate AudioSystem"); + } + /* These values must be kept in sync with system/audio.h */ /* * If these are modified, please also update Settings.System.VOLUME_SETTINGS * and attrs.xml and AudioManager.java. */ - /** Used to identify the default audio stream volume */ + /** @hide Used to identify the default audio stream volume */ + @TestApi public static final int STREAM_DEFAULT = -1; - /** Used to identify the volume of audio streams for phone calls */ + /** @hide Used to identify the volume of audio streams for phone calls */ public static final int STREAM_VOICE_CALL = 0; - /** Used to identify the volume of audio streams for system sounds */ + /** @hide Used to identify the volume of audio streams for system sounds */ public static final int STREAM_SYSTEM = 1; - /** Used to identify the volume of audio streams for the phone ring and message alerts */ + /** @hide Used to identify the volume of audio streams for the phone ring and message alerts */ public static final int STREAM_RING = 2; - /** Used to identify the volume of audio streams for music playback */ + /** @hide Used to identify the volume of audio streams for music playback */ public static final int STREAM_MUSIC = 3; - /** Used to identify the volume of audio streams for alarms */ + /** @hide Used to identify the volume of audio streams for alarms */ public static final int STREAM_ALARM = 4; - /** Used to identify the volume of audio streams for notifications */ + /** @hide Used to identify the volume of audio streams for notifications */ public static final int STREAM_NOTIFICATION = 5; - /** Used to identify the volume of audio streams for phone calls when connected on bluetooth */ + /** @hide + * Used to identify the volume of audio streams for phone calls when connected on bluetooth */ public static final int STREAM_BLUETOOTH_SCO = 6; - /** Used to identify the volume of audio streams for enforced system sounds in certain + /** @hide Used to identify the volume of audio streams for enforced system sounds in certain * countries (e.g camera in Japan) */ @UnsupportedAppUsage public static final int STREAM_SYSTEM_ENFORCED = 7; - /** Used to identify the volume of audio streams for DTMF tones */ + /** @hide Used to identify the volume of audio streams for DTMF tones */ public static final int STREAM_DTMF = 8; - /** Used to identify the volume of audio streams exclusively transmitted through the + /** @hide Used to identify the volume of audio streams exclusively transmitted through the * speaker (TTS) of the device */ public static final int STREAM_TTS = 9; - /** Used to identify the volume of audio streams for accessibility prompts */ + /** @hide Used to identify the volume of audio streams for accessibility prompts */ public static final int STREAM_ACCESSIBILITY = 10; - /** Used to identify the volume of audio streams for virtual assistant */ + /** @hide Used to identify the volume of audio streams for virtual assistant */ public static final int STREAM_ASSISTANT = 11; /** + * @hide * @deprecated Use {@link #numStreamTypes() instead} */ public static final int NUM_STREAMS = 5; @@ -96,9 +106,16 @@ public class AudioSystem // Expose only the getter method publicly so we can change it in the future private static final int NUM_STREAM_TYPES = 12; + + /** + * @hide + * @return total number of stream types + */ @UnsupportedAppUsage + @TestApi public static final int getNumStreamTypes() { return NUM_STREAM_TYPES; } + /** @hide */ public static final String[] STREAM_NAMES = new String[] { "STREAM_VOICE_CALL", "STREAM_SYSTEM", @@ -114,7 +131,8 @@ public class AudioSystem "STREAM_ASSISTANT" }; - /* + /** + * @hide * Sets the microphone mute on or off. * * @param on set <var>true</var> to mute the microphone; @@ -124,7 +142,8 @@ public class AudioSystem @UnsupportedAppUsage public static native int muteMicrophone(boolean on); - /* + /** + * @hide * Checks whether the microphone mute is on or off. * * @return true if microphone is muted, false if it's not @@ -133,15 +152,24 @@ public class AudioSystem public static native boolean isMicrophoneMuted(); /* modes for setPhoneState, must match AudioSystem.h audio_mode */ + /** @hide */ public static final int MODE_INVALID = -2; + /** @hide */ public static final int MODE_CURRENT = -1; + /** @hide */ public static final int MODE_NORMAL = 0; + /** @hide */ public static final int MODE_RINGTONE = 1; + /** @hide */ public static final int MODE_IN_CALL = 2; + /** @hide */ public static final int MODE_IN_COMMUNICATION = 3; + /** @hide */ public static final int MODE_CALL_SCREENING = 4; + /** @hide */ public static final int NUM_MODES = 5; + /** @hide */ public static String modeToString(int mode) { switch (mode) { case MODE_CURRENT: return "MODE_CURRENT"; @@ -156,15 +184,23 @@ public class AudioSystem } /* Formats for A2DP codecs, must match system/audio-base.h audio_format_t */ + /** @hide */ public static final int AUDIO_FORMAT_INVALID = 0xFFFFFFFF; + /** @hide */ public static final int AUDIO_FORMAT_DEFAULT = 0; + /** @hide */ public static final int AUDIO_FORMAT_AAC = 0x04000000; + /** @hide */ public static final int AUDIO_FORMAT_SBC = 0x1F000000; + /** @hide */ public static final int AUDIO_FORMAT_APTX = 0x20000000; + /** @hide */ public static final int AUDIO_FORMAT_APTX_HD = 0x21000000; + /** @hide */ public static final int AUDIO_FORMAT_LDAC = 0x23000000; /** + * @hide * Convert audio format enum values to Bluetooth codec values */ public static int audioFormatToBluetoothSourceCodec(int audioFormat) { @@ -179,25 +215,27 @@ public class AudioSystem } /* Routing bits for the former setRouting/getRouting API */ - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_EARPIECE = (1 << 0); - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_SPEAKER = (1 << 1); - /** @deprecated use {@link #ROUTE_BLUETOOTH_SCO} */ + /** @hide @deprecated use {@link #ROUTE_BLUETOOTH_SCO} */ @Deprecated public static final int ROUTE_BLUETOOTH = (1 << 2); - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_BLUETOOTH_SCO = (1 << 2); - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_HEADSET = (1 << 3); - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_BLUETOOTH_A2DP = (1 << 4); - /** @deprecated */ + /** @hide @deprecated */ @Deprecated public static final int ROUTE_ALL = 0xFFFFFFFF; // Keep in sync with system/media/audio/include/system/audio.h + /** @hide */ public static final int AUDIO_SESSION_ALLOCATE = 0; - /* + /** + * @hide * Checks whether the specified stream type is active. * * return true if any track playing on this stream is active. @@ -205,7 +243,8 @@ public class AudioSystem @UnsupportedAppUsage public static native boolean isStreamActive(int stream, int inPastMs); - /* + /** + * @hide * Checks whether the specified stream type is active on a remotely connected device. The notion * of what constitutes a remote device is enforced by the audio policy manager of the platform. * @@ -213,7 +252,8 @@ public class AudioSystem */ public static native boolean isStreamActiveRemotely(int stream, int inPastMs); - /* + /** + * @hide * Checks whether the specified audio source is active. * * return true if any recorder using this source is currently recording @@ -221,23 +261,27 @@ public class AudioSystem @UnsupportedAppUsage public static native boolean isSourceActive(int source); - /* + /** + * @hide * Returns a new unused audio session ID */ public static native int newAudioSessionId(); - /* + /** + * @hide * Returns a new unused audio player ID */ public static native int newAudioPlayerId(); /** + * @hide * Returns a new unused audio recorder ID */ public static native int newAudioRecorderId(); - /* + /** + * @hide * Sets a group generic audio configuration parameters. The use of these parameters * are platform dependent, see libaudio * @@ -247,7 +291,8 @@ public class AudioSystem @UnsupportedAppUsage public static native int setParameters(String keyValuePairs); - /* + /** + * @hide * Gets a group generic audio configuration parameters. The use of these parameters * are platform dependent, see libaudio * @@ -259,16 +304,16 @@ public class AudioSystem public static native String getParameters(String keys); // These match the enum AudioError in frameworks/base/core/jni/android_media_AudioSystem.cpp - /* Command sucessful or Media server restarted. see ErrorCallback */ + /** @hide Command successful or Media server restarted. see ErrorCallback */ public static final int AUDIO_STATUS_OK = 0; - /* Command failed or unspecified audio error. see ErrorCallback */ + /** @hide Command failed or unspecified audio error. see ErrorCallback */ public static final int AUDIO_STATUS_ERROR = 1; - /* Media server died. see ErrorCallback */ + /** @hide Media server died. see ErrorCallback */ public static final int AUDIO_STATUS_SERVER_DIED = 100; - private static ErrorCallback mErrorCallback; + private static ErrorCallback sErrorCallback; - /* + /** @hide * Handles the audio error callback. */ public interface ErrorCallback @@ -283,7 +328,8 @@ public class AudioSystem void onError(int error); }; - /* + /** + * @hide * Registers a callback to be invoked when an error occurs. * @param cb the callback to run */ @@ -291,7 +337,7 @@ public class AudioSystem public static void setErrorCallback(ErrorCallback cb) { synchronized (AudioSystem.class) { - mErrorCallback = cb; + sErrorCallback = cb; if (cb != null) { cb.onError(checkAudioFlinger()); } @@ -303,8 +349,8 @@ public class AudioSystem { ErrorCallback errorCallback = null; synchronized (AudioSystem.class) { - if (mErrorCallback != null) { - errorCallback = mErrorCallback; + if (sErrorCallback != null) { + errorCallback = sErrorCallback; } } if (errorCallback != null) { @@ -313,6 +359,7 @@ public class AudioSystem } /** + * @hide * Handles events from the audio policy manager about dynamic audio policies * @see android.media.audiopolicy.AudioPolicy */ @@ -326,6 +373,7 @@ public class AudioSystem private static DynamicPolicyCallback sDynPolicyCallback; + /** @hide */ public static void setDynamicPolicyCallback(DynamicPolicyCallback cb) { synchronized (AudioSystem.class) { @@ -355,6 +403,7 @@ public class AudioSystem } /** + * @hide * Handles events from the audio policy manager about recording events * @see android.media.AudioManager.AudioRecordingCallback */ @@ -386,6 +435,7 @@ public class AudioSystem private static AudioRecordingCallback sRecordingCallback; + /** @hide */ public static void setRecordingCallback(AudioRecordingCallback cb) { synchronized (AudioSystem.class) { sRecordingCallback = cb; @@ -434,13 +484,21 @@ public class AudioSystem * Error codes used by public APIs (AudioTrack, AudioRecord, AudioManager ...) * Must be kept in sync with frameworks/base/core/jni/android_media_AudioErrors.h */ + /** @hide */ public static final int SUCCESS = 0; + /** @hide */ public static final int ERROR = -1; + /** @hide */ public static final int BAD_VALUE = -2; + /** @hide */ public static final int INVALID_OPERATION = -3; + /** @hide */ public static final int PERMISSION_DENIED = -4; + /** @hide */ public static final int NO_INIT = -5; + /** @hide */ public static final int DEAD_OBJECT = -6; + /** @hide */ public static final int WOULD_BLOCK = -7; /** @hide */ @@ -458,6 +516,7 @@ public class AudioSystem public @interface AudioSystemError {} /** + * @hide * Convert an int error value to its String value for readability. * Accepted error values are the java AudioSystem errors, matching android_media_AudioErrors.h, * which map onto the native status_t type. @@ -494,74 +553,113 @@ public class AudioSystem // // audio device definitions: must be kept in sync with values in system/core/audio.h // - + /** @hide */ public static final int DEVICE_NONE = 0x0; // reserved bits + /** @hide */ public static final int DEVICE_BIT_IN = 0x80000000; + /** @hide */ public static final int DEVICE_BIT_DEFAULT = 0x40000000; // output devices, be sure to update AudioManager.java also + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_EARPIECE = 0x1; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_SPEAKER = 0x2; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_WIRED_HEADSET = 0x4; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_WIRED_HEADPHONE = 0x8; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_SCO = 0x10; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_A2DP = 0x80; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_AUX_DIGITAL = 0x400; + /** @hide */ public static final int DEVICE_OUT_HDMI = DEVICE_OUT_AUX_DIGITAL; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_USB_ACCESSORY = 0x2000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_USB_DEVICE = 0x4000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_REMOTE_SUBMIX = 0x8000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_TELEPHONY_TX = 0x10000; + /** @hide */ public static final int DEVICE_OUT_LINE = 0x20000; + /** @hide */ public static final int DEVICE_OUT_HDMI_ARC = 0x40000; + /** @hide */ public static final int DEVICE_OUT_SPDIF = 0x80000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_FM = 0x100000; + /** @hide */ public static final int DEVICE_OUT_AUX_LINE = 0x200000; + /** @hide */ public static final int DEVICE_OUT_SPEAKER_SAFE = 0x400000; + /** @hide */ public static final int DEVICE_OUT_IP = 0x800000; + /** @hide */ public static final int DEVICE_OUT_BUS = 0x1000000; + /** @hide */ public static final int DEVICE_OUT_PROXY = 0x2000000; + /** @hide */ public static final int DEVICE_OUT_USB_HEADSET = 0x4000000; + /** @hide */ public static final int DEVICE_OUT_HEARING_AID = 0x8000000; + /** @hide */ public static final int DEVICE_OUT_DEFAULT = DEVICE_BIT_DEFAULT; // Deprecated in R because multiple device types are no longer accessed as a bit mask. // Removing this will get lint warning about changing hidden apis. + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_OUT_ALL_USB = (DEVICE_OUT_USB_ACCESSORY | DEVICE_OUT_USB_DEVICE | DEVICE_OUT_USB_HEADSET); + /** @hide */ public static final Set<Integer> DEVICE_OUT_ALL_SET; + /** @hide */ public static final Set<Integer> DEVICE_OUT_ALL_A2DP_SET; + /** @hide */ public static final Set<Integer> DEVICE_OUT_ALL_SCO_SET; + /** @hide */ public static final Set<Integer> DEVICE_OUT_ALL_USB_SET; + /** @hide */ public static final Set<Integer> DEVICE_OUT_ALL_HDMI_SYSTEM_AUDIO_SET; + /** @hide */ public static final Set<Integer> DEVICE_ALL_HDMI_SYSTEM_AUDIO_AND_SPEAKER_SET; static { DEVICE_OUT_ALL_SET = new HashSet<>(); @@ -621,53 +719,85 @@ public class AudioSystem } // input devices + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_COMMUNICATION = DEVICE_BIT_IN | 0x1; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_AMBIENT = DEVICE_BIT_IN | 0x2; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_BUILTIN_MIC = DEVICE_BIT_IN | 0x4; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_BLUETOOTH_SCO_HEADSET = DEVICE_BIT_IN | 0x8; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_WIRED_HEADSET = DEVICE_BIT_IN | 0x10; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_AUX_DIGITAL = DEVICE_BIT_IN | 0x20; + /** @hide */ public static final int DEVICE_IN_HDMI = DEVICE_IN_AUX_DIGITAL; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_VOICE_CALL = DEVICE_BIT_IN | 0x40; + /** @hide */ public static final int DEVICE_IN_TELEPHONY_RX = DEVICE_IN_VOICE_CALL; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_BACK_MIC = DEVICE_BIT_IN | 0x80; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_REMOTE_SUBMIX = DEVICE_BIT_IN | 0x100; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_ANLG_DOCK_HEADSET = DEVICE_BIT_IN | 0x200; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_DGTL_DOCK_HEADSET = DEVICE_BIT_IN | 0x400; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_USB_ACCESSORY = DEVICE_BIT_IN | 0x800; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_USB_DEVICE = DEVICE_BIT_IN | 0x1000; + /** @hide */ public static final int DEVICE_IN_FM_TUNER = DEVICE_BIT_IN | 0x2000; + /** @hide */ public static final int DEVICE_IN_TV_TUNER = DEVICE_BIT_IN | 0x4000; + /** @hide */ public static final int DEVICE_IN_LINE = DEVICE_BIT_IN | 0x8000; + /** @hide */ public static final int DEVICE_IN_SPDIF = DEVICE_BIT_IN | 0x10000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_BLUETOOTH_A2DP = DEVICE_BIT_IN | 0x20000; + /** @hide */ public static final int DEVICE_IN_LOOPBACK = DEVICE_BIT_IN | 0x40000; + /** @hide */ public static final int DEVICE_IN_IP = DEVICE_BIT_IN | 0x80000; + /** @hide */ public static final int DEVICE_IN_BUS = DEVICE_BIT_IN | 0x100000; + /** @hide */ public static final int DEVICE_IN_PROXY = DEVICE_BIT_IN | 0x1000000; + /** @hide */ public static final int DEVICE_IN_USB_HEADSET = DEVICE_BIT_IN | 0x2000000; + /** @hide */ public static final int DEVICE_IN_BLUETOOTH_BLE = DEVICE_BIT_IN | 0x4000000; + /** @hide */ public static final int DEVICE_IN_HDMI_ARC = DEVICE_BIT_IN | 0x8000000; + /** @hide */ public static final int DEVICE_IN_ECHO_REFERENCE = DEVICE_BIT_IN | 0x10000000; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_IN_DEFAULT = DEVICE_BIT_IN | DEVICE_BIT_DEFAULT; + /** @hide */ public static final Set<Integer> DEVICE_IN_ALL_SET; + /** @hide */ public static final Set<Integer> DEVICE_IN_ALL_SCO_SET; + /** @hide */ public static final Set<Integer> DEVICE_IN_ALL_USB_SET; static { DEVICE_IN_ALL_SET = new HashSet<>(); @@ -708,15 +838,19 @@ public class AudioSystem DEVICE_IN_ALL_USB_SET.add(DEVICE_IN_USB_HEADSET); } + /** @hide */ public static final String LEGACY_REMOTE_SUBMIX_ADDRESS = "0"; // device states, must match AudioSystem::device_connection_state + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_STATE_UNAVAILABLE = 0; + /** @hide */ @UnsupportedAppUsage public static final int DEVICE_STATE_AVAILABLE = 1; private static final int NUM_DEVICE_STATES = 1; + /** @hide */ public static String deviceStateToString(int state) { switch (state) { case DEVICE_STATE_UNAVAILABLE: return "DEVICE_STATE_UNAVAILABLE"; @@ -725,63 +859,65 @@ public class AudioSystem } } - public static final String DEVICE_OUT_EARPIECE_NAME = "earpiece"; - public static final String DEVICE_OUT_SPEAKER_NAME = "speaker"; - public static final String DEVICE_OUT_WIRED_HEADSET_NAME = "headset"; - public static final String DEVICE_OUT_WIRED_HEADPHONE_NAME = "headphone"; - public static final String DEVICE_OUT_BLUETOOTH_SCO_NAME = "bt_sco"; - public static final String DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME = "bt_sco_hs"; - public static final String DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME = "bt_sco_carkit"; - public static final String DEVICE_OUT_BLUETOOTH_A2DP_NAME = "bt_a2dp"; + /** @hide */ public static final String DEVICE_OUT_EARPIECE_NAME = "earpiece"; + /** @hide */ public static final String DEVICE_OUT_SPEAKER_NAME = "speaker"; + /** @hide */ public static final String DEVICE_OUT_WIRED_HEADSET_NAME = "headset"; + /** @hide */ public static final String DEVICE_OUT_WIRED_HEADPHONE_NAME = "headphone"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_SCO_NAME = "bt_sco"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME = "bt_sco_hs"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME = "bt_sco_carkit"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_A2DP_NAME = "bt_a2dp"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME = "bt_a2dp_hp"; - public static final String DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME = "bt_a2dp_spk"; - public static final String DEVICE_OUT_AUX_DIGITAL_NAME = "aux_digital"; - public static final String DEVICE_OUT_HDMI_NAME = "hdmi"; - public static final String DEVICE_OUT_ANLG_DOCK_HEADSET_NAME = "analog_dock"; - public static final String DEVICE_OUT_DGTL_DOCK_HEADSET_NAME = "digital_dock"; - public static final String DEVICE_OUT_USB_ACCESSORY_NAME = "usb_accessory"; - public static final String DEVICE_OUT_USB_DEVICE_NAME = "usb_device"; - public static final String DEVICE_OUT_REMOTE_SUBMIX_NAME = "remote_submix"; - public static final String DEVICE_OUT_TELEPHONY_TX_NAME = "telephony_tx"; - public static final String DEVICE_OUT_LINE_NAME = "line"; - public static final String DEVICE_OUT_HDMI_ARC_NAME = "hmdi_arc"; - public static final String DEVICE_OUT_SPDIF_NAME = "spdif"; - public static final String DEVICE_OUT_FM_NAME = "fm_transmitter"; - public static final String DEVICE_OUT_AUX_LINE_NAME = "aux_line"; - public static final String DEVICE_OUT_SPEAKER_SAFE_NAME = "speaker_safe"; - public static final String DEVICE_OUT_IP_NAME = "ip"; - public static final String DEVICE_OUT_BUS_NAME = "bus"; - public static final String DEVICE_OUT_PROXY_NAME = "proxy"; - public static final String DEVICE_OUT_USB_HEADSET_NAME = "usb_headset"; - public static final String DEVICE_OUT_HEARING_AID_NAME = "hearing_aid_out"; - - public static final String DEVICE_IN_COMMUNICATION_NAME = "communication"; - public static final String DEVICE_IN_AMBIENT_NAME = "ambient"; - public static final String DEVICE_IN_BUILTIN_MIC_NAME = "mic"; - public static final String DEVICE_IN_BLUETOOTH_SCO_HEADSET_NAME = "bt_sco_hs"; - public static final String DEVICE_IN_WIRED_HEADSET_NAME = "headset"; - public static final String DEVICE_IN_AUX_DIGITAL_NAME = "aux_digital"; - public static final String DEVICE_IN_TELEPHONY_RX_NAME = "telephony_rx"; - public static final String DEVICE_IN_BACK_MIC_NAME = "back_mic"; - public static final String DEVICE_IN_REMOTE_SUBMIX_NAME = "remote_submix"; - public static final String DEVICE_IN_ANLG_DOCK_HEADSET_NAME = "analog_dock"; - public static final String DEVICE_IN_DGTL_DOCK_HEADSET_NAME = "digital_dock"; - public static final String DEVICE_IN_USB_ACCESSORY_NAME = "usb_accessory"; - public static final String DEVICE_IN_USB_DEVICE_NAME = "usb_device"; - public static final String DEVICE_IN_FM_TUNER_NAME = "fm_tuner"; - public static final String DEVICE_IN_TV_TUNER_NAME = "tv_tuner"; - public static final String DEVICE_IN_LINE_NAME = "line"; - public static final String DEVICE_IN_SPDIF_NAME = "spdif"; - public static final String DEVICE_IN_BLUETOOTH_A2DP_NAME = "bt_a2dp"; - public static final String DEVICE_IN_LOOPBACK_NAME = "loopback"; - public static final String DEVICE_IN_IP_NAME = "ip"; - public static final String DEVICE_IN_BUS_NAME = "bus"; - public static final String DEVICE_IN_PROXY_NAME = "proxy"; - public static final String DEVICE_IN_USB_HEADSET_NAME = "usb_headset"; - public static final String DEVICE_IN_BLUETOOTH_BLE_NAME = "bt_ble"; - public static final String DEVICE_IN_ECHO_REFERENCE_NAME = "echo_reference"; - public static final String DEVICE_IN_HDMI_ARC_NAME = "hdmi_arc"; + /** @hide */ public static final String DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME = "bt_a2dp_spk"; + /** @hide */ public static final String DEVICE_OUT_AUX_DIGITAL_NAME = "aux_digital"; + /** @hide */ public static final String DEVICE_OUT_HDMI_NAME = "hdmi"; + /** @hide */ public static final String DEVICE_OUT_ANLG_DOCK_HEADSET_NAME = "analog_dock"; + /** @hide */ public static final String DEVICE_OUT_DGTL_DOCK_HEADSET_NAME = "digital_dock"; + /** @hide */ public static final String DEVICE_OUT_USB_ACCESSORY_NAME = "usb_accessory"; + /** @hide */ public static final String DEVICE_OUT_USB_DEVICE_NAME = "usb_device"; + /** @hide */ public static final String DEVICE_OUT_REMOTE_SUBMIX_NAME = "remote_submix"; + /** @hide */ public static final String DEVICE_OUT_TELEPHONY_TX_NAME = "telephony_tx"; + /** @hide */ public static final String DEVICE_OUT_LINE_NAME = "line"; + /** @hide */ public static final String DEVICE_OUT_HDMI_ARC_NAME = "hmdi_arc"; + /** @hide */ public static final String DEVICE_OUT_SPDIF_NAME = "spdif"; + /** @hide */ public static final String DEVICE_OUT_FM_NAME = "fm_transmitter"; + /** @hide */ public static final String DEVICE_OUT_AUX_LINE_NAME = "aux_line"; + /** @hide */ public static final String DEVICE_OUT_SPEAKER_SAFE_NAME = "speaker_safe"; + /** @hide */ public static final String DEVICE_OUT_IP_NAME = "ip"; + /** @hide */ public static final String DEVICE_OUT_BUS_NAME = "bus"; + /** @hide */ public static final String DEVICE_OUT_PROXY_NAME = "proxy"; + /** @hide */ public static final String DEVICE_OUT_USB_HEADSET_NAME = "usb_headset"; + /** @hide */ public static final String DEVICE_OUT_HEARING_AID_NAME = "hearing_aid_out"; + + /** @hide */ public static final String DEVICE_IN_COMMUNICATION_NAME = "communication"; + /** @hide */ public static final String DEVICE_IN_AMBIENT_NAME = "ambient"; + /** @hide */ public static final String DEVICE_IN_BUILTIN_MIC_NAME = "mic"; + /** @hide */ public static final String DEVICE_IN_BLUETOOTH_SCO_HEADSET_NAME = "bt_sco_hs"; + /** @hide */ public static final String DEVICE_IN_WIRED_HEADSET_NAME = "headset"; + /** @hide */ public static final String DEVICE_IN_AUX_DIGITAL_NAME = "aux_digital"; + /** @hide */ public static final String DEVICE_IN_TELEPHONY_RX_NAME = "telephony_rx"; + /** @hide */ public static final String DEVICE_IN_BACK_MIC_NAME = "back_mic"; + /** @hide */ public static final String DEVICE_IN_REMOTE_SUBMIX_NAME = "remote_submix"; + /** @hide */ public static final String DEVICE_IN_ANLG_DOCK_HEADSET_NAME = "analog_dock"; + /** @hide */ public static final String DEVICE_IN_DGTL_DOCK_HEADSET_NAME = "digital_dock"; + /** @hide */ public static final String DEVICE_IN_USB_ACCESSORY_NAME = "usb_accessory"; + /** @hide */ public static final String DEVICE_IN_USB_DEVICE_NAME = "usb_device"; + /** @hide */ public static final String DEVICE_IN_FM_TUNER_NAME = "fm_tuner"; + /** @hide */ public static final String DEVICE_IN_TV_TUNER_NAME = "tv_tuner"; + /** @hide */ public static final String DEVICE_IN_LINE_NAME = "line"; + /** @hide */ public static final String DEVICE_IN_SPDIF_NAME = "spdif"; + /** @hide */ public static final String DEVICE_IN_BLUETOOTH_A2DP_NAME = "bt_a2dp"; + /** @hide */ public static final String DEVICE_IN_LOOPBACK_NAME = "loopback"; + /** @hide */ public static final String DEVICE_IN_IP_NAME = "ip"; + /** @hide */ public static final String DEVICE_IN_BUS_NAME = "bus"; + /** @hide */ public static final String DEVICE_IN_PROXY_NAME = "proxy"; + /** @hide */ public static final String DEVICE_IN_USB_HEADSET_NAME = "usb_headset"; + /** @hide */ public static final String DEVICE_IN_BLUETOOTH_BLE_NAME = "bt_ble"; + /** @hide */ public static final String DEVICE_IN_ECHO_REFERENCE_NAME = "echo_reference"; + /** @hide */ public static final String DEVICE_IN_HDMI_ARC_NAME = "hdmi_arc"; + /** @hide */ @UnsupportedAppUsage public static String getOutputDeviceName(int device) { @@ -848,6 +984,7 @@ public class AudioSystem } } + /** @hide */ public static String getInputDeviceName(int device) { switch(device) { @@ -910,6 +1047,7 @@ public class AudioSystem } /** + * @hide * Returns a human readable name for a given device type * @param device a native device type, NOT an AudioDeviceInfo type * @return a string describing the device type @@ -922,35 +1060,31 @@ public class AudioSystem } // phone state, match audio_mode??? - public static final int PHONE_STATE_OFFCALL = 0; - public static final int PHONE_STATE_RINGING = 1; - public static final int PHONE_STATE_INCALL = 2; + /** @hide */ public static final int PHONE_STATE_OFFCALL = 0; + /** @hide */ public static final int PHONE_STATE_RINGING = 1; + /** @hide */ public static final int PHONE_STATE_INCALL = 2; // device categories config for setForceUse, must match audio_policy_forced_cfg_t - @UnsupportedAppUsage - public static final int FORCE_NONE = 0; - public static final int FORCE_SPEAKER = 1; - public static final int FORCE_HEADPHONES = 2; - public static final int FORCE_BT_SCO = 3; - public static final int FORCE_BT_A2DP = 4; - public static final int FORCE_WIRED_ACCESSORY = 5; - @UnsupportedAppUsage - public static final int FORCE_BT_CAR_DOCK = 6; - @UnsupportedAppUsage - public static final int FORCE_BT_DESK_DOCK = 7; - @UnsupportedAppUsage - public static final int FORCE_ANALOG_DOCK = 8; - @UnsupportedAppUsage - public static final int FORCE_DIGITAL_DOCK = 9; - public static final int FORCE_NO_BT_A2DP = 10; - public static final int FORCE_SYSTEM_ENFORCED = 11; - public static final int FORCE_HDMI_SYSTEM_AUDIO_ENFORCED = 12; - public static final int FORCE_ENCODED_SURROUND_NEVER = 13; - public static final int FORCE_ENCODED_SURROUND_ALWAYS = 14; - public static final int FORCE_ENCODED_SURROUND_MANUAL = 15; - public static final int NUM_FORCE_CONFIG = 16; - public static final int FORCE_DEFAULT = FORCE_NONE; + /** @hide */ @UnsupportedAppUsage public static final int FORCE_NONE = 0; + /** @hide */ public static final int FORCE_SPEAKER = 1; + /** @hide */ public static final int FORCE_HEADPHONES = 2; + /** @hide */ public static final int FORCE_BT_SCO = 3; + /** @hide */ public static final int FORCE_BT_A2DP = 4; + /** @hide */ public static final int FORCE_WIRED_ACCESSORY = 5; + /** @hide */ @UnsupportedAppUsage public static final int FORCE_BT_CAR_DOCK = 6; + /** @hide */ @UnsupportedAppUsage public static final int FORCE_BT_DESK_DOCK = 7; + /** @hide */ @UnsupportedAppUsage public static final int FORCE_ANALOG_DOCK = 8; + /** @hide */ @UnsupportedAppUsage public static final int FORCE_DIGITAL_DOCK = 9; + /** @hide */ public static final int FORCE_NO_BT_A2DP = 10; + /** @hide */ public static final int FORCE_SYSTEM_ENFORCED = 11; + /** @hide */ public static final int FORCE_HDMI_SYSTEM_AUDIO_ENFORCED = 12; + /** @hide */ public static final int FORCE_ENCODED_SURROUND_NEVER = 13; + /** @hide */ public static final int FORCE_ENCODED_SURROUND_ALWAYS = 14; + /** @hide */ public static final int FORCE_ENCODED_SURROUND_MANUAL = 15; + /** @hide */ public static final int NUM_FORCE_CONFIG = 16; + /** @hide */ public static final int FORCE_DEFAULT = FORCE_NONE; + /** @hide */ public static String forceUseConfigToString(int config) { switch (config) { case FORCE_NONE: return "FORCE_NONE"; @@ -974,16 +1108,17 @@ public class AudioSystem } // usage for setForceUse, must match audio_policy_force_use_t - public static final int FOR_COMMUNICATION = 0; - public static final int FOR_MEDIA = 1; - public static final int FOR_RECORD = 2; - public static final int FOR_DOCK = 3; - public static final int FOR_SYSTEM = 4; - public static final int FOR_HDMI_SYSTEM_AUDIO = 5; - public static final int FOR_ENCODED_SURROUND = 6; - public static final int FOR_VIBRATE_RINGING = 7; + /** @hide */ public static final int FOR_COMMUNICATION = 0; + /** @hide */ public static final int FOR_MEDIA = 1; + /** @hide */ public static final int FOR_RECORD = 2; + /** @hide */ public static final int FOR_DOCK = 3; + /** @hide */ public static final int FOR_SYSTEM = 4; + /** @hide */ public static final int FOR_HDMI_SYSTEM_AUDIO = 5; + /** @hide */ public static final int FOR_ENCODED_SURROUND = 6; + /** @hide */ public static final int FOR_VIBRATE_RINGING = 7; private static final int NUM_FORCE_USE = 8; + /** @hide */ public static String forceUseUsageToString(int usage) { switch (usage) { case FOR_COMMUNICATION: return "FOR_COMMUNICATION"; @@ -998,7 +1133,7 @@ public class AudioSystem } } - /** Wrapper for native methods called from AudioService */ + /** @hide Wrapper for native methods called from AudioService */ public static int setStreamVolumeIndexAS(int stream, int index, int device) { if (DEBUG_VOLUME) { Log.i(TAG, "setStreamVolumeIndex: " + STREAM_NAMES[stream] @@ -1008,10 +1143,11 @@ public class AudioSystem } // usage for AudioRecord.startRecordingSync(), must match AudioSystem::sync_event_t - public static final int SYNC_EVENT_NONE = 0; - public static final int SYNC_EVENT_PRESENTATION_COMPLETE = 1; + /** @hide */ public static final int SYNC_EVENT_NONE = 0; + /** @hide */ public static final int SYNC_EVENT_PRESENTATION_COMPLETE = 1; /** + * @hide * @return command completion status, one of {@link #AUDIO_STATUS_OK}, * {@link #AUDIO_STATUS_ERROR} or {@link #AUDIO_STATUS_SERVER_DIED} */ @@ -1019,12 +1155,15 @@ public class AudioSystem public static native int setDeviceConnectionState(int device, int state, String device_address, String device_name, int codecFormat); + /** @hide */ @UnsupportedAppUsage public static native int getDeviceConnectionState(int device, String device_address); + /** @hide */ public static native int handleDeviceConfigChange(int device, String device_address, String device_name, int codecFormat); + /** @hide */ @UnsupportedAppUsage public static int setPhoneState(int state) { Log.w(TAG, "Do not use this method! Use AudioManager.setMode() instead."); @@ -1038,14 +1177,18 @@ public class AudioSystem * @return command completion status. */ public static native int setPhoneState(int state, int uid); + /** @hide */ @UnsupportedAppUsage public static native int setForceUse(int usage, int config); + /** @hide */ @UnsupportedAppUsage public static native int getForceUse(int usage); + /** @hide */ @UnsupportedAppUsage public static native int initStreamVolume(int stream, int indexMin, int indexMax); @UnsupportedAppUsage private static native int setStreamVolumeIndex(int stream, int index, int device); + /** @hide */ public static native int getStreamVolumeIndex(int stream, int device); /** * @hide @@ -1082,16 +1225,22 @@ public class AudioSystem */ public static native int getMaxVolumeIndexForAttributes(@NonNull AudioAttributes attributes); + /** @hide */ public static native int setMasterVolume(float value); + /** @hide */ public static native float getMasterVolume(); + /** @hide */ @UnsupportedAppUsage public static native int setMasterMute(boolean mute); + /** @hide */ @UnsupportedAppUsage public static native boolean getMasterMute(); + /** @hide */ @UnsupportedAppUsage public static native int getDevicesForStream(int stream); /** + * @hide * Do not use directly, see {@link AudioManager#getDevicesForAttributes(AudioAttributes)} * Get the audio devices that would be used for the routing of the given audio attributes. * @param attributes the {@link AudioAttributes} for which the routing is being queried @@ -1136,31 +1285,43 @@ public class AudioSystem /** @hide returns master balance value in range -1.f -> 1.f, where 0.f is dead center. */ @TestApi public static native float getMasterBalance(); - /** @hide changes the audio balance of the device. */ + /** @hide Changes the audio balance of the device. */ @TestApi public static native int setMasterBalance(float balance); // helpers for android.media.AudioManager.getProperty(), see description there for meaning + /** @hide */ @UnsupportedAppUsage(trackingBug = 134049522) public static native int getPrimaryOutputSamplingRate(); + /** @hide */ @UnsupportedAppUsage(trackingBug = 134049522) public static native int getPrimaryOutputFrameCount(); + /** @hide */ @UnsupportedAppUsage public static native int getOutputLatency(int stream); + /** @hide */ public static native int setLowRamDevice(boolean isLowRamDevice, long totalMemory); + /** @hide */ @UnsupportedAppUsage public static native int checkAudioFlinger(); + /** @hide */ public static native int listAudioPorts(ArrayList<AudioPort> ports, int[] generation); + /** @hide */ public static native int createAudioPatch(AudioPatch[] patch, AudioPortConfig[] sources, AudioPortConfig[] sinks); + /** @hide */ public static native int releaseAudioPatch(AudioPatch patch); + /** @hide */ public static native int listAudioPatches(ArrayList<AudioPatch> patches, int[] generation); + /** @hide */ public static native int setAudioPortConfig(AudioPortConfig config); + /** @hide */ public static native int startAudioSource(AudioPortConfig config, AudioAttributes audioAttributes); + /** @hide */ public static native int stopAudioSource(int handle); // declare this instance as having a dynamic policy callback handler @@ -1169,36 +1330,42 @@ public class AudioSystem private static native final void native_register_recording_callback(); // must be kept in sync with value in include/system/audio.h - public static final int AUDIO_HW_SYNC_INVALID = 0; + /** @hide */ public static final int AUDIO_HW_SYNC_INVALID = 0; + /** @hide */ public static native int getAudioHwSyncForSession(int sessionId); + /** @hide */ public static native int registerPolicyMixes(ArrayList<AudioMix> mixes, boolean register); - /** see AudioPolicy.setUidDeviceAffinities() */ + /** @hide see AudioPolicy.setUidDeviceAffinities() */ public static native int setUidDeviceAffinities(int uid, @NonNull int[] types, @NonNull String[] addresses); - /** see AudioPolicy.removeUidDeviceAffinities() */ + /** @hide see AudioPolicy.removeUidDeviceAffinities() */ public static native int removeUidDeviceAffinities(int uid); - /** see AudioPolicy.setUserIdDeviceAffinities() */ + /** @hide see AudioPolicy.setUserIdDeviceAffinities() */ public static native int setUserIdDeviceAffinities(int userId, @NonNull int[] types, @NonNull String[] addresses); - /** see AudioPolicy.removeUserIdDeviceAffinities() */ + /** @hide see AudioPolicy.removeUserIdDeviceAffinities() */ public static native int removeUserIdDeviceAffinities(int userId); + /** @hide */ public static native int systemReady(); + /** @hide */ public static native float getStreamVolumeDB(int stream, int index, int device); /** + * @hide * Communicate supported system usages to audio policy service. */ public static native int setSupportedSystemUsages(int[] systemUsages); /** + * @hide * @see AudioManager#setAllowedCapturePolicy() */ public static native int setAllowedCapturePolicy(int uid, int flags); @@ -1212,45 +1379,57 @@ public class AudioSystem private static native boolean native_is_offload_supported(int encoding, int sampleRate, int channelMask, int channelIndexMask, int streamType); + /** @hide */ public static native int getMicrophones(ArrayList<MicrophoneInfo> microphonesInfo); + /** @hide */ public static native int getSurroundFormats(Map<Integer, Boolean> surroundFormats, boolean reported); /** + * @hide * Returns a list of audio formats (codec) supported on the A2DP offload path. */ public static native int getHwOffloadEncodingFormatsSupportedForA2DP( ArrayList<Integer> formatList); + /** @hide */ public static native int setSurroundFormatEnabled(int audioFormat, boolean enabled); /** + * @hide * Communicate UID of active assistant to audio policy service. */ public static native int setAssistantUid(int uid); + /** + * @hide * Communicate UIDs of active accessibility services to audio policy service. */ public static native int setA11yServicesUids(int[] uids); + /** + * @hide * Communicate UID of current InputMethodService to audio policy service. */ public static native int setCurrentImeUid(int uid); /** + * @hide * @see AudioManager#isHapticPlaybackSupported() */ public static native boolean isHapticPlaybackSupported(); /** + * @hide * Send audio HAL server process pids to native audioserver process for use * when generating audio HAL servers tombstones */ public static native int setAudioHalPids(int[] pids); /** + * @hide * @see AudioManager#isCallScreeningModeSupported() */ public static native boolean isCallScreeningModeSupported(); @@ -1258,6 +1437,7 @@ public class AudioSystem // use case routing by product strategy /** + * @hide * Sets the preferred device to use for a given audio strategy in the audio policy engine * @param strategy the id of the strategy to configure * @param device the device type and address to route to when available @@ -1270,6 +1450,7 @@ public class AudioSystem device.getAddress()); } /** + * @hide * Set device routing per product strategy. * @param strategy the id of the strategy to configure * @param deviceType the native device type, NOT AudioDeviceInfo types @@ -1280,6 +1461,7 @@ public class AudioSystem int strategy, int deviceType, String deviceAddress); /** + * @hide * Remove preferred routing for the strategy * @param strategy the id of the strategy to configure * @return {@link #SUCCESS} if successfully removed @@ -1287,6 +1469,7 @@ public class AudioSystem public static native int removePreferredDeviceForStrategy(int strategy); /** + * @hide * Query previously set preferred device for a strategy * @param strategy the id of the strategy to query for * @param device an array of size 1 that will contain the preferred device, or null if @@ -1300,6 +1483,7 @@ public class AudioSystem // Items shared with audio service /** + * @hide * The delay before playing a sound. This small period exists so the user * can press another key (non-volume keys, too) to have it NOT be audible. * <p> @@ -1308,6 +1492,7 @@ public class AudioSystem public static final int PLAY_SOUND_DELAY = 300; /** + * @hide * Constant to identify a focus stack entry that is used to hold the focus while the phone * is ringing or during a call. Used by com.android.internal.telephony.CallManager when * entering and exiting calls. @@ -1315,6 +1500,7 @@ public class AudioSystem public final static String IN_VOICE_COMM_FOCUS_ID = "AudioFocus_For_Phone_Ring_And_Calls"; /** + * @hide * @see AudioManager#setVibrateSetting(int, int) */ public static int getValueForVibrateSetting(int existingValue, int vibrateType, @@ -1330,10 +1516,12 @@ public class AudioSystem return existingValue; } + /** @hide */ public static int getDefaultStreamVolume(int streamType) { return DEFAULT_STREAM_VOLUME[streamType]; } + /** @hide */ public static int[] DEFAULT_STREAM_VOLUME = new int[] { 4, // STREAM_VOICE_CALL 7, // STREAM_SYSTEM @@ -1349,20 +1537,22 @@ public class AudioSystem 5, // STREAM_ASSISTANT }; + /** @hide */ public static String streamToString(int stream) { if (stream >= 0 && stream < STREAM_NAMES.length) return STREAM_NAMES[stream]; if (stream == AudioManager.USE_DEFAULT_STREAM_TYPE) return "USE_DEFAULT_STREAM_TYPE"; return "UNKNOWN_STREAM_" + stream; } - /** The platform has no specific capabilities */ + /** @hide The platform has no specific capabilities */ public static final int PLATFORM_DEFAULT = 0; - /** The platform is voice call capable (a phone) */ + /** @hide The platform is voice call capable (a phone) */ public static final int PLATFORM_VOICE = 1; - /** The platform is a television or a set-top box */ + /** @hide The platform is a television or a set-top box */ public static final int PLATFORM_TELEVISION = 2; /** + * @hide * Return the platform type that this is running on. One of: * <ul> * <li>{@link #PLATFORM_VOICE}</li> @@ -1392,6 +1582,7 @@ public class AudioSystem } /** + * @hide * Return a set of audio device types from a bit mask audio device type, which may * represent multiple audio device types. * FIXME: Remove this when getting ride of bit mask usage of audio device types. @@ -1409,6 +1600,7 @@ public class AudioSystem } /** + * @hide * Return the intersection of two audio device types collections. */ public static Set<Integer> intersectionAudioDeviceTypes( @@ -1419,12 +1611,14 @@ public class AudioSystem } /** + * @hide * Return true if the audio device types collection only contains the given device type. */ public static boolean isSingleAudioDeviceType(@NonNull Set<Integer> types, int type) { return types.size() == 1 && types.contains(type); } + /** @hide */ public static final int DEFAULT_MUTE_STREAMS_AFFECTED = (1 << STREAM_MUSIC) | (1 << STREAM_RING) | @@ -1434,6 +1628,7 @@ public class AudioSystem (1 << STREAM_BLUETOOTH_SCO); /** + * @hide * Event posted by AudioTrack and AudioRecord JNI (JNIDeviceCallback) when routing changes. * Keep in sync with core/jni/android_media_DeviceCallback.h. */ |