diff --git a/api/current.txt b/api/current.txt index 57fa18352396c..05ddea7cb4571 100644 --- a/api/current.txt +++ b/api/current.txt @@ -15932,6 +15932,7 @@ package android.media.audiofx { method public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; method public boolean getSpeakerAngles(int, int, int[]) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; method public boolean getStrengthSupported(); + method public int getVirtualizationMode() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; method public void setParameterListener(android.media.audiofx.Virtualizer.OnParameterChangeListener); method public void setProperties(android.media.audiofx.Virtualizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; method public void setStrength(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; diff --git a/media/java/android/media/audiofx/Virtualizer.java b/media/java/android/media/audiofx/Virtualizer.java index 78eeccba6239f..b314c02b7870a 100644 --- a/media/java/android/media/audiofx/Virtualizer.java +++ b/media/java/android/media/audiofx/Virtualizer.java @@ -349,8 +349,6 @@ public class Virtualizer extends AudioEffect { } /** - * @hide - * CANDIDATE FOR PUBLIC API * Return the device type which reflects the virtualization mode being used, if any. * @return a device type (as defined in {@link AudioDevice}) which reflects the virtualization * mode being used. @@ -358,8 +356,18 @@ public class Virtualizer extends AudioEffect { * {@link AudioDevice#DEVICE_TYPE_UNKNOWN}. Virtualization may not be active either because * the effect is not enabled or because the current output device is not compatible with * this virtualization implementation. + *

Note that the return value may differ from a device type successfully set with + * {@link #forceVirtualizationMode(int)} as the implementation + * may use a single mode for multiple devices. An example of this is with + * {@link AudioDevice#DEVICE_TYPE_WIRED_HEADSET} that would typically be handled + * like {@link AudioDevice#DEVICE_TYPE_WIRED_HEADPHONES} from a virtualization + * standpoint. + * @throws IllegalStateException + * @throws IllegalArgumentException + * @throws UnsupportedOperationException */ - public int getVirtualizationMode() { + public int getVirtualizationMode() + throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException { int[] value = new int[1]; int status = getParameter(PARAM_VIRTUALIZATION_MODE, value); if (status >= 0) {