Merge "AudioManager.getSpatializer() never returns null" into sc-v2-dev am: 6357c1c42b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15828642 Change-Id: Ibc214c310fc5d2686f71d20057c72b9dbdde5e87
This commit is contained in:
@@ -20467,7 +20467,7 @@ package android.media {
|
|||||||
method public String getProperty(String);
|
method public String getProperty(String);
|
||||||
method public int getRingerMode();
|
method public int getRingerMode();
|
||||||
method @Deprecated public int getRouting(int);
|
method @Deprecated public int getRouting(int);
|
||||||
method @Nullable public android.media.Spatializer getSpatializer();
|
method @NonNull public android.media.Spatializer getSpatializer();
|
||||||
method public int getStreamMaxVolume(int);
|
method public int getStreamMaxVolume(int);
|
||||||
method public int getStreamMinVolume(int);
|
method public int getStreamMinVolume(int);
|
||||||
method public int getStreamVolume(int);
|
method public int getStreamVolume(int);
|
||||||
@@ -23867,9 +23867,13 @@ package android.media {
|
|||||||
public class Spatializer {
|
public class Spatializer {
|
||||||
method public void addOnSpatializerStateChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.Spatializer.OnSpatializerStateChangedListener);
|
method public void addOnSpatializerStateChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.Spatializer.OnSpatializerStateChangedListener);
|
||||||
method public boolean canBeSpatialized(@NonNull android.media.AudioAttributes, @NonNull android.media.AudioFormat);
|
method public boolean canBeSpatialized(@NonNull android.media.AudioAttributes, @NonNull android.media.AudioFormat);
|
||||||
|
method public int getImmersiveAudioLevel();
|
||||||
method public boolean isAvailable();
|
method public boolean isAvailable();
|
||||||
method public boolean isEnabled();
|
method public boolean isEnabled();
|
||||||
method public void removeOnSpatializerStateChangedListener(@NonNull android.media.Spatializer.OnSpatializerStateChangedListener);
|
method public void removeOnSpatializerStateChangedListener(@NonNull android.media.Spatializer.OnSpatializerStateChangedListener);
|
||||||
|
field public static final int SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL = 1; // 0x1
|
||||||
|
field public static final int SPATIALIZER_IMMERSIVE_LEVEL_NONE = 0; // 0x0
|
||||||
|
field public static final int SPATIALIZER_IMMERSIVE_LEVEL_OTHER = -1; // 0xffffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Spatializer.OnSpatializerStateChangedListener {
|
public static interface Spatializer.OnSpatializerStateChangedListener {
|
||||||
|
|||||||
@@ -2444,15 +2444,10 @@ public class AudioManager {
|
|||||||
/**
|
/**
|
||||||
* Return a handle to the optional platform's {@link Spatializer}
|
* Return a handle to the optional platform's {@link Spatializer}
|
||||||
* @return the {@code Spatializer} instance.
|
* @return the {@code Spatializer} instance.
|
||||||
|
* @see Spatializer#getImmersiveAudioLevel() to check for the level of support of the effect
|
||||||
|
* on the platform
|
||||||
*/
|
*/
|
||||||
public @Nullable Spatializer getSpatializer() {
|
public @NonNull Spatializer getSpatializer() {
|
||||||
int level = Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE;
|
|
||||||
try {
|
|
||||||
level = getService().getSpatializerImmersiveAudioLevel();
|
|
||||||
} catch (Exception e) { /* using NONE */ }
|
|
||||||
if (level == Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Spatializer(this);
|
return new Spatializer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ public class Spatializer {
|
|||||||
public @interface ImmersiveAudioLevel {};
|
public @interface ImmersiveAudioLevel {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
|
||||||
* Constant indicating the {@code Spatializer} on this device supports a spatialization
|
* Constant indicating the {@code Spatializer} on this device supports a spatialization
|
||||||
* mode that differs from the ones available at this SDK level.
|
* mode that differs from the ones available at this SDK level.
|
||||||
* @see #getImmersiveAudioLevel()
|
* @see #getImmersiveAudioLevel()
|
||||||
@@ -130,14 +129,12 @@ public class Spatializer {
|
|||||||
public static final int SPATIALIZER_IMMERSIVE_LEVEL_OTHER = -1;
|
public static final int SPATIALIZER_IMMERSIVE_LEVEL_OTHER = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
|
||||||
* Constant indicating there are no spatialization capabilities supported on this device.
|
* Constant indicating there are no spatialization capabilities supported on this device.
|
||||||
* @see #getImmersiveAudioLevel()
|
* @see #getImmersiveAudioLevel()
|
||||||
*/
|
*/
|
||||||
public static final int SPATIALIZER_IMMERSIVE_LEVEL_NONE = 0;
|
public static final int SPATIALIZER_IMMERSIVE_LEVEL_NONE = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
|
||||||
* Constant indicating the {@code Spatializer} on this device supports multichannel
|
* Constant indicating the {@code Spatializer} on this device supports multichannel
|
||||||
* spatialization.
|
* spatialization.
|
||||||
* @see #getImmersiveAudioLevel()
|
* @see #getImmersiveAudioLevel()
|
||||||
@@ -145,7 +142,6 @@ public class Spatializer {
|
|||||||
public static final int SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL = 1;
|
public static final int SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
|
||||||
* Return the level of support for the spatialization feature on this device.
|
* Return the level of support for the spatialization feature on this device.
|
||||||
* This level of support is independent of whether the {@code Spatializer} is currently
|
* This level of support is independent of whether the {@code Spatializer} is currently
|
||||||
* enabled or available and will not change over time.
|
* enabled or available and will not change over time.
|
||||||
|
|||||||
Reference in New Issue
Block a user