Index: net/cronet/android/sample/src/org/chromium/cronet_sample_apk/LibraryLoader.java |
diff --git a/net/cronet/android/sample/src/org/chromium/cronet_sample_apk/LibraryLoader.java b/net/cronet/android/sample/src/org/chromium/cronet_sample_apk/LibraryLoader.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e2dfa828a777a6e74c2bf5f4b61653ffec20d2fa |
--- /dev/null |
+++ b/net/cronet/android/sample/src/org/chromium/cronet_sample_apk/LibraryLoader.java |
@@ -0,0 +1,23 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.cronet_sample_apk; |
+ |
+import android.util.Log; |
+ |
+/** |
+ * Cronet Library Loader. |
+ */ |
+public class LibraryLoader { |
+ private static final String TAG = "LibraryLoader"; |
+ private static Boolean sInitialized = false; |
+ |
+ public static void ensureInitialized() throws UnsatisfiedLinkError { |
+ if (sInitialized) |
+ return; |
+ sInitialized = true; |
+ System.loadLibrary("cronet"); |
+ Log.i(TAG, "libcronet initialization success."); |
+ } |
+} |