Merge "Update ziparchive usage to the new API."
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index e4fad09..b5e068d 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -209,7 +209,8 @@
 	libjpeg \
 	libusbhost \
 	libharfbuzz_ng \
-	libz
+	libz \
+	libnativebridge
 
 ifeq ($(USE_OPENGL_RENDERER),true)
 	LOCAL_SHARED_LIBRARIES += libhwui
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 98ea9a2..274d1a2 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -798,7 +798,7 @@
                                    "-Xmx", "-Xcompiler-option");
         if (skip_compilation) {
             addOption("-Xcompiler-option");
-            addOption("--compiler-filter=interpret-only");
+            addOption("--compiler-filter=verify-none");
         } else {
             parseCompilerOption("dalvik.vm.dex2oat-filter", dex2oatCompilerFilterBuf,
                                 "--compiler-filter=", "-Xcompiler-option");
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index 9c44093..633a207 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -38,6 +38,8 @@
 #include "android_view_InputChannel.h"
 #include "android_view_KeyEvent.h"
 
+#include "nativebridge/native_bridge.h"
+
 #define LOG_TRACE(...)
 //#define LOG_TRACE(...) ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)
 
@@ -251,17 +253,29 @@
 
     const char* pathStr = env->GetStringUTFChars(path, NULL);
     NativeCode* code = NULL;
-    
+    bool needNativeBridge = false;
+
     void* handle = dlopen(pathStr, RTLD_LAZY);
-    
+    if (handle == NULL) {
+        if (NativeBridgeIsSupported(pathStr)) {
+            handle = NativeBridgeLoadLibrary(pathStr, RTLD_LAZY);
+            needNativeBridge = true;
+        }
+    }
     env->ReleaseStringUTFChars(path, pathStr);
-    
+
     if (handle != NULL) {
+        void* funcPtr = NULL;
         const char* funcStr = env->GetStringUTFChars(funcName, NULL);
-        code = new NativeCode(handle, (ANativeActivity_createFunc*)
-                dlsym(handle, funcStr));
+        if (needNativeBridge) {
+            funcPtr = NativeBridgeGetTrampoline(handle, funcStr, NULL, 0);
+        } else {
+            funcPtr = dlsym(handle, funcStr);
+        }
+
+        code = new NativeCode(handle, (ANativeActivity_createFunc*)funcPtr);
         env->ReleaseStringUTFChars(funcName, funcStr);
-        
+
         if (code->createActivityFunc == NULL) {
             ALOGW("ANativeActivity_onCreate not found");
             delete code;
diff --git a/tools/obbtool/Main.cpp b/tools/obbtool/Main.cpp
index b2152e8..64808c0 100644
--- a/tools/obbtool/Main.cpp
+++ b/tools/obbtool/Main.cpp
@@ -89,7 +89,7 @@
         "   Prints the OBB signature information of a file.\n\n", gProgName);
 }
 
-void doAdd(const char* filename, struct PackageInfo* info) {
+void doAdd(const char* filename, PackageInfo* info) {
     ObbFile *obb = new ObbFile();
     if (obb->readFrom(filename)) {
         fprintf(stderr, "ERROR: %s: OBB signature already present\n", filename);
@@ -182,7 +182,7 @@
 {
     int opt;
     int option_index = 0;
-    struct PackageInfo package_info;
+    PackageInfo package_info;
 
     int result = 1;    // pessimistically assume an error.