summaryrefslogtreecommitdiff
path: root/sal/android/libreofficekit-jni.c
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-06-28 19:21:49 +0200
committerJan Holesovsky <kendy@collabora.com>2014-06-30 14:48:03 +0200
commitc72d300ba0fa6eb3a496bdd8f3bbd3baa1b0f70e (patch)
tree2bd1afb40f219d96fc05f3c0a9fb0883253a1e27 /sal/android/libreofficekit-jni.c
parentdb89e5ff812e2b807476cdf0a10cd81a3040d79b (diff)
android: Make the extract_files() part of setup / init.
We need to have the files extracted before we attempt to initialize LibreOfficeKit (call libreofficekit_hook), otherwise the .rdb's are not there. Change-Id: Ib49db7e945a709d18a063eb488a27df18fef542b
Diffstat (limited to 'sal/android/libreofficekit-jni.c')
-rw-r--r--sal/android/libreofficekit-jni.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index cf8308afa01b..3dcf773e9cf1 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -37,7 +37,6 @@ extern int apk_file_size;
extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject clazz, jstring string);
extern void Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env, jobject clazz, jboolean state);
-extern void Java_org_libreoffice_android_Bootstrap_extract_1files(JNIEnv* env, jobject clazz);
extern LibreOfficeKit *libreofficekit_hook(const char* install_path);
@@ -63,15 +62,6 @@ Java_org_libreoffice_android_LibreOfficeKit_redirect_1stdio(JNIEnv* env,
Java_org_libreoffice_android_Bootstrap_redirect_1stdio(env, clazz, state);
}
-/// Call the same method from Bootstrap.
-__attribute__ ((visibility("default")))
-void
-Java_org_libreoffice_android_LibreOfficeKit_extract_1files(JNIEnv* env,
- jobject clazz)
-{
- Java_org_libreoffice_android_Bootstrap_extract_1files(env, clazz);
-}
-
/// Initialize the LibreOfficeKit.
__attribute__ ((visibility("default")))
jboolean
@@ -136,6 +126,11 @@ Java_org_libreoffice_android_LibreOfficeKit_init__Ljava_lang_String_2Ljava_lang_
return JNI_FALSE;
}
+ // Extract files from the .apk that can't be used mmapped directly from it
+ extract_files(UNPACK_TREE, UNPACK_TREE, 0);
+ extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1);
+
+ // Initialize LibreOfficeKit
pOffice = libreofficekit_hook(data_dir);
if (!pOffice)
{