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

Unified Diff: webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java

Issue 2888093004: Removes usage of native base::android::GetApplicationContext() (Closed)
Patch Set: Fix modules unittests. 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
« no previous file with comments | « webrtc/pc/test/androidtestinitializer.cc ('k') | webrtc/sdk/android/src/jni/peerconnection_jni.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java
diff --git a/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java
index 28b3ca72ab9b98e4f74db5d2a7f80bf3955cfc18..b7d85f04e3fc230d56c1fa5943be49d62e6160ca 100644
--- a/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java
+++ b/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactory.java
@@ -10,6 +10,7 @@
package org.webrtc;
+import android.content.Context;
import java.util.List;
/**
@@ -30,6 +31,7 @@ public class PeerConnectionFactory {
private static final String TAG = "PeerConnectionFactory";
private final long nativeFactory;
+ private static Context applicationContext;
private static Thread networkThread;
private static Thread workerThread;
private static Thread signalingThread;
@@ -52,14 +54,19 @@ public class PeerConnectionFactory {
// Must be called at least once before creating a PeerConnectionFactory
// (for example, at application startup time).
- public static native void initializeAndroidGlobals(
- android.content.Context context, boolean videoHwAcceleration);
+ public static native void nativeInitializeAndroidGlobals(
+ Context context, boolean videoHwAcceleration);
+
+ public static void initializeAndroidGlobals(Context context, boolean videoHwAcceleration) {
+ ContextUtils.initialize(context);
+ nativeInitializeAndroidGlobals(context, videoHwAcceleration);
+ }
// Older signature of initializeAndroidGlobals. The extra parameters are now meaningless.
@Deprecated
public static boolean initializeAndroidGlobals(Object context, boolean initializeAudio,
boolean initializeVideo, boolean videoHwAcceleration) {
- initializeAndroidGlobals((android.content.Context) context, videoHwAcceleration);
+ initializeAndroidGlobals((Context) context, videoHwAcceleration);
return true;
}
« no previous file with comments | « webrtc/pc/test/androidtestinitializer.cc ('k') | webrtc/sdk/android/src/jni/peerconnection_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698