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

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: 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..4a172ca46301e6005f9126463724f5543764cecc 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;
@@ -144,18 +145,20 @@ public class JniInterface {
* 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.
+ * THIS IS SKETCHY: the code doesn't update the app context, and the comment doesn't make sense.
Torne 2015/11/06 16:51:34 remoting folks: the comment here isn't consistent
Lambros 2015/11/06 19:46:03 The comment seems to be outdated, probably all the
*/
public static void loadLibrary(Context context) {
if (sLoaded) return;
System.loadLibrary("remoting_client_jni");
- nativeLoadNative(context);
+ ContextUtils.initApplicationContext(context);
+ 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