public interface AudioDeviceChangeObserver
You should register the callback via AudioManager#setAudioDeviceChangeObserver to receive notifications
about the changes.
SystemCapability.Multimedia#AUDIO| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onAudioDeviceChange(int reason,
AudioDeviceDescriptor[] devices) |
Called upon device state changes to receive the change reason and device information.
|
void onAudioDeviceChange(int reason,
AudioDeviceDescriptor[] devices)
reason - Indicates the change reason. The value can be AudioDeviceChangeType#DEVICE_AVAILABLE
(for connection) or (AudioDeviceChangeType#DEVICE_UNAVAILABLE (for disconnection).devices - Indicates a list of device information, including device types and audio formats supported by
the devices.