summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-04-02 12:38:23 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-04-02 12:39:52 +0300
commita9a50cd9ffcd53c631fd13d20aa7e0609d92fc4d (patch)
tree810d3fb6564d46fa573785d6c6b8efc9ed321941 /android
parent2906a654d0c59adae71f4c0fb1c72adb3d5477a0 (diff)
Refactor where patch_libgnustl_shared() and extract_files() are called
Diffstat (limited to 'android')
-rw-r--r--android/Bootstrap/src/org/libreoffice/android/Bootstrap.java15
-rw-r--r--android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java3
2 files changed, 14 insertions, 4 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
index c60c9e975a64..443b770f90d5 100644
--- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
+++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
@@ -38,6 +38,7 @@ import android.util.Log;
import fi.iki.tml.CommandLine;
import java.io.File;
+import java.io.InputStream;
import java.util.Arrays;
import java.util.Scanner;
@@ -73,7 +74,10 @@ public class Bootstrap extends NativeActivity
// To be called after you are sure libgnustl_shared.so
// has been loaded
- public static native void patch_libgnustl_shared();
+ static native void patch_libgnustl_shared();
+
+ // Extracts files in the .apk that need to be extraced into the app's tree
+ static native void extract_files();
// Wrapper for getpid()
public static native int getpid();
@@ -97,6 +101,8 @@ public class Bootstrap extends NativeActivity
// (contentbroker.cxx), also this called indirectly through the lo-bootstrap library
public static native void initUCBHelper();
+ // This setup() method is called 1) in apps that use *this* class as their activity from onCreate(),
+ // and 2) should be called from other kinds of LO code using apps.
public static void setup(Activity activity)
{
String dataDir = null;
@@ -114,6 +120,13 @@ public class Bootstrap extends NativeActivity
if (!setup(dataDir, activity.getApplication().getPackageResourcePath(), llpa))
return;
+ // We build LO code against the shared GNU C++ library
+ dlopen("libgnustl_shared.so");
+ // and need to patch it.
+ patch_libgnustl_shared();
+
+ // Extract files from the .apk that can't be used mmapped directly from it
+ extract_files();
}
@Override
diff --git a/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java b/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
index d47a6ef5edee..93ed87e26cfd 100644
--- a/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
+++ b/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
@@ -52,9 +52,6 @@ public class DocumentLoader
Bootstrap.putenv("SAL_LOG=yes");
- Bootstrap.dlopen("libgnustl_shared.so");
- Bootstrap.patch_libgnustl_shared();
-
// Load a lot of shlibs here explicitly in advance because that
// makes debugging work better, sigh
Bootstrap.dlopen("libvcllo.so");