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

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

Issue 1873383002: [remoting android] Move JNI loading to Application.onCreate() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@android-host-add-native
Patch Set: rebase, (c) 2016 Created 4 years, 8 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
Index: remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java
diff --git a/remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java b/remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java
index a85adcd487f2ee243ed0cc2613d340f12217eecc..f8f7fb96e043fcf6072cb1b1f1a3feb4e954ddda 100644
--- a/remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java
+++ b/remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java
@@ -18,16 +18,14 @@ public class Host {
// Pointer to the C++ object, cast to a |long|.
private long mNativeJniHost;
- private static boolean sLoaded;
-
- // Called once from the main Activity. Loads and initializes the native
- // code.
+ /**
+ * To be called once from the Application context singleton. Loads and initializes the native
+ * code. Called on the UI thread.
+ * @param context The Application context.
+ */
public static void loadLibrary(Context context) {
- if (sLoaded) return;
-
System.loadLibrary("remoting_host_jni");
- ContextUtils.initApplicationContext(context.getApplicationContext());
- sLoaded = true;
+ ContextUtils.initApplicationContext(context);
}
public Host() {

Powered by Google App Engine
This is Rietveld 408576698