Index: webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java |
diff --git a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java |
index ba93ea1fb20a3c5aefb2a2032b7a46c060a6dbea..762a903f0df9a6844fe5114ec91248a9bceb2533 100644 |
--- a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java |
+++ b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java |
@@ -19,7 +19,6 @@ |
import java.lang.System; |
import java.nio.ByteBuffer; |
import java.util.concurrent.TimeUnit; |
-import org.webrtc.ContextUtils; |
import org.webrtc.Logging; |
import org.webrtc.ThreadUtils; |
@@ -48,6 +47,7 @@ |
private static final long AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS = 2000; |
private final long nativeAudioRecord; |
+ private final Context context; |
private WebRtcAudioEffects effects = null; |
@@ -139,8 +139,9 @@ |
} |
} |
- WebRtcAudioRecord(long nativeAudioRecord) { |
+ WebRtcAudioRecord(Context context, long nativeAudioRecord) { |
Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo()); |
+ this.context = context; |
this.nativeAudioRecord = nativeAudioRecord; |
if (DEBUG) { |
WebRtcAudioUtils.logDeviceInfo(TAG); |
@@ -168,8 +169,7 @@ |
private int initRecording(int sampleRate, int channels) { |
Logging.d(TAG, "initRecording(sampleRate=" + sampleRate + ", channels=" + channels + ")"); |
- if (!WebRtcAudioUtils.hasPermission( |
- ContextUtils.getApplicationContext(), android.Manifest.permission.RECORD_AUDIO)) { |
+ if (!WebRtcAudioUtils.hasPermission(context, android.Manifest.permission.RECORD_AUDIO)) { |
reportWebRtcAudioRecordInitError("RECORD_AUDIO permission is missing"); |
return -1; |
} |