Revert of Removes usage of native base::android::GetApplicationContext() (patchset #6 id:120001 of https://codereview.webrtc.org/2888093004/ )

Reason for revert:
Breaks bot on chromium.webrtc.fyi.

Original issue's description:
> Removes usage of native base::android::GetApplicationContext()
>
> BUG=webrtc:7665
>
> Review-Url: https://codereview.webrtc.org/2888093004
> Cr-Commit-Position: refs/heads/master@{#18195}
> Committed: bc83e2ee69

TBR=magjed@webrtc.org,henrika@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7665

Review-Url: https://codereview.webrtc.org/2894593002
Cr-Commit-Position: refs/heads/master@{#18196}
This commit is contained in:
sakal
2017-05-18 06:44:20 -07:00
committed by Commit bot
parent bc83e2ee69
commit 40d224814a
19 changed files with 54 additions and 219 deletions

View File

@ -10,7 +10,6 @@
package org.webrtc;
import android.content.Context;
import java.util.List;
/**
@ -31,7 +30,6 @@ 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;
@ -54,19 +52,14 @@ public class PeerConnectionFactory {
// Must be called at least once before creating a PeerConnectionFactory
// (for example, at application startup time).
public static native void nativeInitializeAndroidGlobals(
Context context, boolean videoHwAcceleration);
public static void initializeAndroidGlobals(Context context, boolean videoHwAcceleration) {
ContextUtils.initialize(context);
nativeInitializeAndroidGlobals(context, videoHwAcceleration);
}
public static native void initializeAndroidGlobals(
android.content.Context context, boolean 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((Context) context, videoHwAcceleration);
initializeAndroidGlobals((android.content.Context) context, videoHwAcceleration);
return true;
}