mirror of
https://github.com/androidx/media.git
synced 2025-05-05 06:30:24 +08:00
Swap HDMI case and non-HDMI case in AudioCapabilities.
This commit is contained in:
parent
773d3c52f1
commit
6b4cf4d362
@ -115,7 +115,13 @@ public final class AudioCapabilities {
|
||||
supportedEncodings.addAll(Ints.asList(Api29.getDirectPlaybackSupportedEncodings()));
|
||||
}
|
||||
|
||||
if (intent == null || intent.getIntExtra(AudioManager.EXTRA_AUDIO_PLUG_STATE, 0) == 0) {
|
||||
if (intent == null || intent.getIntExtra(AudioManager.EXTRA_AUDIO_PLUG_STATE, 0) == 1) {
|
||||
supportedEncodings.addAll(Ints.asList(
|
||||
intent.getIntArrayExtra(AudioManager.EXTRA_ENCODINGS)));
|
||||
return new AudioCapabilities(
|
||||
Ints.toArray(supportedEncodings.build()), /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT);
|
||||
}
|
||||
|
||||
if (supportedEncodings.build().isEmpty()) {
|
||||
return DEFAULT_AUDIO_CAPABILITIES;
|
||||
} else {
|
||||
@ -124,12 +130,6 @@ public final class AudioCapabilities {
|
||||
}
|
||||
}
|
||||
|
||||
supportedEncodings.addAll(Ints.asList(
|
||||
intent.getIntArrayExtra(AudioManager.EXTRA_ENCODINGS)));
|
||||
return new AudioCapabilities(
|
||||
Ints.toArray(supportedEncodings.build()), /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the global settings {@link Uri} used by the device to specify external surround sound,
|
||||
* or null if the device does not support this functionality.
|
||||
|
Loading…
x
Reference in New Issue
Block a user