diff options
Diffstat (limited to 'android/media/AudioManager.java')
-rw-r--r-- | android/media/AudioManager.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/android/media/AudioManager.java b/android/media/AudioManager.java index 913b5e84..2ac4063d 100644 --- a/android/media/AudioManager.java +++ b/android/media/AudioManager.java @@ -1329,6 +1329,19 @@ public class AudioManager { } //==================================================================== + // Offload query + /** + * Returns whether offloaded playback of an audio format is supported on the device. + * Offloaded playback is where the decoding of an audio stream is not competing with other + * software resources. In general, it is supported by dedicated hardware, such as audio DSPs. + * @param format the audio format (codec, sample rate, channels) being checked. + * @return true if the given audio format can be offloaded. + */ + public boolean isOffloadedPlaybackSupported(@NonNull AudioFormat format) { + return AudioSystem.isOffloadSupported(format); + } + + //==================================================================== // Bluetooth SCO control /** * Sticky broadcast intent action indicating that the Bluetooth SCO audio @@ -3746,6 +3759,33 @@ public class AudioManager { } /** + * Indicate A2DP source or sink connection state change and eventually suppress + * the {@link AudioManager.ACTION_AUDIO_BECOMING_NOISY} intent. + * @param device Bluetooth device connected/disconnected + * @param state new connection state (BluetoothProfile.STATE_xxx) + * @param profile profile for the A2DP device + * (either {@link android.bluetooth.BluetoothProfile.A2DP} or + * {@link android.bluetooth.BluetoothProfile.A2DP_SINK}) + * @param suppressNoisyIntent if true the + * {@link AudioManager.ACTION_AUDIO_BECOMING_NOISY} intent will not be sent. + * @return a delay in ms that the caller should wait before broadcasting + * BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED intent. + * {@hide} + */ + public int setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( + BluetoothDevice device, int state, int profile, boolean suppressNoisyIntent) { + final IAudioService service = getService(); + int delay = 0; + try { + delay = service.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(device, + state, profile, suppressNoisyIntent); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + return delay; + } + + /** * Indicate A2DP device configuration has changed. * @param device Bluetooth device whose configuration has changed. * {@hide} |