Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / xwalk / app / android / runtime_client / src / org / xwalk / app / runtime / XWalkRuntimeClient.java
index c3d4d05..f5d6861 100644 (file)
@@ -112,36 +112,23 @@ public class XWalkRuntimeClient extends CrossPackageWrapper {
 
     @Override
     public void handleException(Exception e) {
+        // Here is for handling runtime library not found,
+        // Should never happen if runtime is embedded.
+        if (libraryIsEmbedded()) throw new RuntimeException(e);
+
+        // XWalkView will handle UnsatisfiedLinkError which indicates mismatch of CPU architecture.
+        // So exception here should be either library not installed for shared mode or invoke error.
         Exception toHandle = e;
-        boolean wrongNativeLibraryAbi = false;
         if (mRuntimeLoaded) {
             toHandle = new XWalkRuntimeLibraryException(
                     XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_INVOKE_FAILED, e);
         } else {
             if (!(e instanceof XWalkRuntimeLibraryException)) {
-                Throwable rootCause = e;
-                while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
-                    rootCause = rootCause.getCause();
-                }
-                // UnsatisfiedLinkError happens when the libxwalkcore.so is not found.
-                // If the runtime library package exist, but the native library not, it can
-                // be considered that the installed runtime lib apk is for another cpu
-                // architecture.
-                if (rootCause instanceof UnsatisfiedLinkError) {
-                    wrongNativeLibraryAbi = true;
-                    toHandle = new XWalkRuntimeLibraryException(
-                            XWalkRuntimeLibraryException.XWALK_CORE_LIBRARY_SO_NOT_EXIST, e);
-                } else {
-                    toHandle = new XWalkRuntimeLibraryException(
-                            XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_NOT_INSTALLED, e);
-                }
+                toHandle = new XWalkRuntimeLibraryException(
+                        XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_NOT_INSTALLED, e);
             }
         }
-        // Here is for handling runtime library not found or not match,
-        // if library is embedded, should not invoke it.
-        // Except the error is for incorrect abi, which could also happen for
-        // embedded mode.
-        if (!libraryIsEmbedded() || wrongNativeLibraryAbi) super.handleException(toHandle);
+        super.handleException(toHandle);
     }
 
     public FrameLayout get() {