Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1424)

Unified Diff: webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java

Issue 2988533002: Fixing lint issue (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
diff --git a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
index f4803ba94abf305896feb5997af8548e63e0a83b..ac6c8772660b7cf2405708b0bae313baf7fd1f27 100644
--- a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
+++ b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
@@ -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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698