Removes usage of native base::android::GetApplicationContext()

BUG=webrtc:7665

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

View File

@ -118,8 +118,7 @@ class JNIEnvironment {
// JNIEnv* jni = ::base::android::AttachCurrentThread();
// JavaVM* jvm = NULL;
// jni->GetJavaVM(&jvm);
// jobject context = ::base::android::GetApplicationContext();
// webrtc::JVM::Initialize(jvm, context);
// webrtc::JVM::Initialize(jvm);
//
// // Header (.h) file of example class called User.
// std::unique_ptr<JNIEnvironment> env;
@ -145,9 +144,9 @@ class JNIEnvironment {
// JVM::Uninitialize();
class JVM {
public:
// Stores global handles to the Java VM interface and the application context.
// Stores global handles to the Java VM interface.
// Should be called once on a thread that is attached to the JVM.
static void Initialize(JavaVM* jvm, jobject context);
static void Initialize(JavaVM* jvm);
// Clears handles stored in Initialize(). Must be called on same thread as
// Initialize().
static void Uninitialize();
@ -168,10 +167,9 @@ class JVM {
// TODO(henrika): can we make these private?
JavaVM* jvm() const { return jvm_; }
jobject context() const { return context_; }
protected:
JVM(JavaVM* jvm, jobject context);
JVM(JavaVM* jvm);
~JVM();
private:
@ -179,7 +177,6 @@ class JVM {
rtc::ThreadChecker thread_checker_;
JavaVM* const jvm_;
jobject context_;
};
} // namespace webrtc