Class AudioCapabilitiesReceiver


  • @Deprecated
    public final class AudioCapabilitiesReceiver
    extends Object
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Receives broadcast events indicating changes to the device's audio capabilities, notifying a AudioCapabilitiesReceiver.Listener when audio capability changes occur.
    • Constructor Detail

      • AudioCapabilitiesReceiver

        public AudioCapabilitiesReceiver​(Context context,
                                         AudioCapabilitiesReceiver.Listener listener)
        Deprecated.
        Parameters:
        context - A context for registering the receiver.
        listener - The listener to notify when audio capabilities change.
    • Method Detail

      • register

        public AudioCapabilities register()
        Deprecated.
        Registers the receiver, meaning it will notify the listener when audio capability changes occur. The current audio capabilities will be returned. It is important to call unregister() when the receiver is no longer required.
        Returns:
        The current audio capabilities for the device.
      • unregister

        public void unregister()
        Deprecated.
        Unregisters the receiver, meaning it will no longer notify the listener when audio capability changes occur.