| 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 762a903f0df9a6844fe5114ec91248a9bceb2533..aa07ecaa28b23ded0da9a48b54c632707fead892 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
|
| @@ -22,6 +22,8 @@ import java.util.concurrent.TimeUnit;
|
| import org.webrtc.Logging;
|
| import org.webrtc.ThreadUtils;
|
|
|
| +import org.chromium.base.ContextUtils;
|
| +
|
| public class WebRtcAudioRecord {
|
| private static final boolean DEBUG = false;
|
|
|
| @@ -47,7 +49,6 @@ public class WebRtcAudioRecord {
|
| private static final long AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS = 2000;
|
|
|
| private final long nativeAudioRecord;
|
| - private final Context context;
|
|
|
| private WebRtcAudioEffects effects = null;
|
|
|
| @@ -139,9 +140,8 @@ public class WebRtcAudioRecord {
|
| }
|
| }
|
|
|
| - WebRtcAudioRecord(Context context, long nativeAudioRecord) {
|
| + WebRtcAudioRecord(long nativeAudioRecord) {
|
| Logging.d(TAG, "ctor" + WebRtcAudioUtils.getThreadInfo());
|
| - this.context = context;
|
| this.nativeAudioRecord = nativeAudioRecord;
|
| if (DEBUG) {
|
| WebRtcAudioUtils.logDeviceInfo(TAG);
|
| @@ -169,7 +169,8 @@ public class WebRtcAudioRecord {
|
|
|
| private int initRecording(int sampleRate, int channels) {
|
| Logging.d(TAG, "initRecording(sampleRate=" + sampleRate + ", channels=" + channels + ")");
|
| - if (!WebRtcAudioUtils.hasPermission(context, android.Manifest.permission.RECORD_AUDIO)) {
|
| + if (!WebRtcAudioUtils.hasPermission(
|
| + ContextUtils.getApplicationContext(), android.Manifest.permission.RECORD_AUDIO)) {
|
| reportWebRtcAudioRecordInitError("RECORD_AUDIO permission is missing");
|
| return -1;
|
| }
|
|
|