diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java index e5f2f1e2acfc..c60c9e975a64 100644 --- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java +++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java @@ -93,6 +93,10 @@ public class Bootstrap extends NativeActivity // where the lo-bootstrap library is. public static native void setCommandArgs(String[] argv); + // A wrapper for InitUCBHelper() in he ucbhelper library + // (contentbroker.cxx), also this called indirectly through the lo-bootstrap library + public static native void initUCBHelper(); + public static void setup(Activity activity) { String dataDir = null; 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 882c73c8a02a..93ed87e26cfd 100644 --- a/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java +++ b/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java @@ -91,6 +91,8 @@ public class DocumentLoader Log.i(TAG, "oDesktop is" + (oDesktop!=null ? " not" : "") + " null"); + Bootstrap.initUCBHelper(); + com.sun.star.frame.XComponentLoader xCompLoader = (com.sun.star.frame.XComponentLoader) UnoRuntime.queryInterface( diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c index 27f4e07f0522..068ba7cab069 100644 --- a/sal/android/lo-bootstrap.c +++ b/sal/android/lo-bootstrap.c @@ -1577,6 +1577,27 @@ Java_org_libreoffice_android_Bootstrap_setCommandArgs(JNIEnv* env, (*osl_setCommandArgs)(c_argc, c_argv); } +// public static native void initUCBhelper(); + +__attribute__ ((visibility("default"))) +void +Java_org_libreoffice_android_Bootstrap_initUCBHelper(JNIEnv* env, + jobject clazz) +{ + void (*InitUCBHelper)(void); + (void) env; + (void) clazz; + + /* This obviously should be called only after the ucbhelper so has been loaded */ + + InitUCBHelper = dlsym(RTLD_DEFAULT, "InitUCBHelper"); + if (InitUCBHelper == NULL) { + LOGE("InitUCBHelper: InitUCBHelper not found"); + return; + } + (*InitUCBHelper)(); +} + __attribute__ ((visibility("default"))) JavaVM * lo_get_javavm(void)