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

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

Issue 2903253004: Reland of Removes usage of native base::android::GetApplicationContext() (Closed)
Patch Set: Deprecated comment. Created 3 years, 7 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
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 65c52077c8e9bf054b9a643cba92aa2ed82159e6..796a0821c59e4f1fa422142de76bbc8b6cde34e4 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
@@ -19,6 +19,7 @@ import android.media.AudioTrack;
import android.os.Process;
import java.lang.Thread;
import java.nio.ByteBuffer;
+import org.webrtc.ContextUtils;
import org.webrtc.Logging;
public class WebRtcAudioTrack {
@@ -36,7 +37,6 @@ public class WebRtcAudioTrack {
// Average number of callbacks per second.
private static final int BUFFERS_PER_SECOND = 1000 / CALLBACK_BUFFER_SIZE_MS;
- private final Context context;
private final long nativeAudioTrack;
private final AudioManager audioManager;
@@ -165,11 +165,11 @@ public class WebRtcAudioTrack {
}
}
- WebRtcAudioTrack(Context context, long nativeAudioTrack) {
+ WebRtcAudioTrack(long nativeAudioTrack) {
Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
- this.context = context;
this.nativeAudioTrack = nativeAudioTrack;
- audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+ audioManager =
+ (AudioManager) ContextUtils.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
if (DEBUG) {
WebRtcAudioUtils.logDeviceInfo(TAG);
}

Powered by Google App Engine
This is Rietveld 408576698