From a99e72ca9749d5d4bd8f47b3bf6ca8ed4523418c Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 12 Oct 2021 07:49:23 -0700 Subject: [PATCH] Spatializer: document state getters when feature is unsupported Bug: 202834359 Test: atest SpatializerTest Change-Id: I65b5cb097b84e7b4c8614cf74150c24dfa2f4f0f --- media/java/android/media/Spatializer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/media/java/android/media/Spatializer.java b/media/java/android/media/Spatializer.java index 8b1624b5eb16f..844f16912554f 100644 --- a/media/java/android/media/Spatializer.java +++ b/media/java/android/media/Spatializer.java @@ -63,7 +63,9 @@ public class Spatializer { /** * Returns whether spatialization is enabled or not. * A false value can originate for instance from the user electing to - * disable the feature.
+ * disable the feature, or when the feature is not supported on the device (indicated + * by {@link #getImmersiveAudioLevel()} returning {@link #SPATIALIZER_IMMERSIVE_LEVEL_NONE}). + *
* Note that this state reflects a platform-wide state of the "desire" to use spatialization, * but availability of the audio processing is still dictated by the compatibility between * the effect and the hardware configuration, as indicated by {@link #isAvailable()}. @@ -85,7 +87,10 @@ public class Spatializer { * incompatible with sound spatialization, such as playback on a monophonic speaker.
* Note that spatialization can be available, but disabled by the user, in which case this * method would still return {@code true}, whereas {@link #isEnabled()} - * would return {@code false}. + * would return {@code false}.
+ * Also when the feature is not supported on the device (indicated + * by {@link #getImmersiveAudioLevel()} returning {@link #SPATIALIZER_IMMERSIVE_LEVEL_NONE}), + * the return value will be false. * @return {@code true} if the spatializer effect is available and capable * of processing the audio for the current configuration of the device, * {@code false} otherwise.