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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes to ApplicationStatus Created 5 years, 1 month 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
Index: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
index 5e4cd5e17c396756ecc7fc3ac448af0ea6ec0207..69dbdba28ed2795a8fa12f6470048d77de4c23af 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -9,6 +9,7 @@ import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Looper;
+import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -141,21 +142,21 @@ public class JniInterface {
private static CapabilityManager sCapabilityManager = CapabilityManager.getInstance();
/**
- * To be called once from the main Activity. Any subsequent calls will update the application
- * context, but not reload the library. This is useful e.g. when the activity is closed and the
- * user later wants to return to the application. Called on the UI thread.
+ * To be called once from the main Activity. Loads and initializes the native code.
+ * Called on the UI thread.
*/
public static void loadLibrary(Context context) {
if (sLoaded) return;
System.loadLibrary("remoting_client_jni");
- nativeLoadNative(context);
+ ContextUtils.initApplicationContext(context.getApplicationContext());
+ nativeLoadNative();
sLoaded = true;
}
/** Performs the native portion of the initialization. */
- private static native void nativeLoadNative(Context context);
+ private static native void nativeLoadNative();
/*
* API/OAuth2 keys access.

Powered by Google App Engine
This is Rietveld 408576698