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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.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
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/Chromoting.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85347af93a14982151dcdf877b77c12d1a7ac31e..95b167190a6179c49d27e78eaf88ecc168850576 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -19,24 +19,16 @@ import java.nio.ByteBuffer;
*/
@JNINamespace("remoting")
public class JniInterface {
- /*
- * Library-loading state machine.
- */
- /** Whether the library has been loaded. Accessed on the UI thread. */
- private static boolean sLoaded = false;
-
/**
- * To be called once from the main Activity. Loads and initializes the native code.
- * Called on the UI thread.
+ * 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_client_jni");
- ContextUtils.initApplicationContext(context.getApplicationContext());
+ ContextUtils.initApplicationContext(context);
nativeLoadNative();
- sLoaded = true;
}
/** Performs the native portion of the initialization. */
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/Chromoting.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698