Fixing lint issue
NOTRY=TRUE BUG=NONE Review-Url: https://codereview.webrtc.org/2988533002 Cr-Commit-Position: refs/heads/master@{#19110}
This commit is contained in:
parent
cfccdae57e
commit
3296256f0e
@ -44,7 +44,7 @@ public class WebRtcAudioTrack {
|
||||
|
||||
// By default, WebRTC creates audio tracks with a usage attribute
|
||||
// corresponding to voice communications, such as telephony or VoIP.
|
||||
private static final int DEFAULT_USAGE = AudioAttributes.USAGE_VOICE_COMMUNICATION;
|
||||
private static final int DEFAULT_USAGE = getDefaultUsageAttribute();
|
||||
private static int usageAttribute = DEFAULT_USAGE;
|
||||
|
||||
// This method overrides the default usage attribute and allows the user
|
||||
@ -56,6 +56,20 @@ public class WebRtcAudioTrack {
|
||||
usageAttribute = usage;
|
||||
}
|
||||
|
||||
private static int getDefaultUsageAttribute() {
|
||||
if (WebRtcAudioUtils.runningOnLollipopOrHigher()) {
|
||||
return getDefaultUsageAttributeOnLollipopOrHigher();
|
||||
} else {
|
||||
// Not used on SDKs lower than L.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
private static int getDefaultUsageAttributeOnLollipopOrHigher() {
|
||||
return AudioAttributes.USAGE_VOICE_COMMUNICATION;
|
||||
}
|
||||
|
||||
private final long nativeAudioTrack;
|
||||
private final AudioManager audioManager;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user