From a3ee6642d8325f621f267c951c6a524220646610 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 18 Jul 2014 11:42:38 -0700 Subject: [PATCH] Unhide Virtualizer.getVirtualizationMode() Unhide Virtualizer.getVirtualizationMode() method. Added note in javadoc about the returned value. Declared exceptions that can be thrown by the checkStatus(int) helper function. Change-Id: I4da82d1db1e39ca9dae489559bf1fb5de112c26a --- api/current.txt | 1 + media/java/android/media/audiofx/Virtualizer.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index e4b7396764209..e0f40bffb500f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -15930,6 +15930,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) {