弃用

随着每个版本的发布,特定的 Android API 可能会过时,或需要进行重构,以提供更好的开发者体验或支持新的平台功能。在这些情况下,我们会正式弃用过时的 API,并引导开发者改用替代 API。

弃用意味着我们已结束对这些 API 的官方支持,但开发者可继续访问这些 API。本页重点介绍了此 Android 版本中的一些重要弃用情况。如需查看其他弃用情况,请参阅 API 差异报告

使用空间化程序而非虚拟化程序

First added in Android 12 (API level 32), the Spatializer class lets apps query the capabilities and behavior of sound spatialization on the device. In Android 15, we're deprecating the Virtualizer class. Use AudioAttributes.Builder.setSpatializationBehavior instead to characterize how you want your content to be played when spatialization is supported.

AndroidX media3 ExoPlayer 1.0 enables spatial audio by default for multichannel audio when the device supports it. See this recent blog post and the spatial audio documentation for more information, including APIs to control the feature.