[Libreoffice-commits] .: 2 commits - sal/osl
Tor Lillqvist
tml at kemper.freedesktop.org
Fri Nov 11 12:46:49 PST 2011
sal/osl/android/jni/lo-bootstrap.c | 5 +++
sal/osl/android/src/org/libreoffice/android/Bootstrap.java | 20 +++++++++++--
2 files changed, 22 insertions(+), 3 deletions(-)
New commits:
commit 10e9a3c5b05154be1994ba2b2b28b5bc3ca132b1
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Fri Nov 11 22:43:57 2011 +0200
Intermediate Android commit
diff --git a/sal/osl/android/src/org/libreoffice/android/Bootstrap.java b/sal/osl/android/src/org/libreoffice/android/Bootstrap.java
index ba004e1..8a1632f 100644
--- a/sal/osl/android/src/org/libreoffice/android/Bootstrap.java
+++ b/sal/osl/android/src/org/libreoffice/android/Bootstrap.java
@@ -122,13 +122,27 @@ public class Bootstrap extends Activity
Log.i(TAG, String.format("dataDir=%s\n", dataDir));
}
catch (PackageManager.NameNotFoundException e) {
+ return;
}
- Object mainLibrary = getIntent().getExtras().get("lo-main-library");
+ String mainLibrary = getIntent().getStringExtra("lo-main-library");
- if (mainLibrary != null && mainLibrary instanceof String) {
- int loLib = loadLibrary((String)mainLibrary + ".so");
+ if (mainLibrary != null) {
+ int loLib = loadLibrary(mainLibrary + ".so");
+
+ if (loLib == 0)
+ return;
+
+ // Get "command line" to pass to the LO "program"
+ String cmdLine = getIntent().getStringExtra("lo-main-cmdline");
+ String[] argv;
+ if (cmdLine != null)
+ argv = cmdLine.split(" *");
+ else
+ argv = new String[0];
int loLibMain = dlsym(loLib, "lo_main");
+ if (loLibMain != 0)
+ dlcall(loLibMain, argv);
}
}
commit 62bfb39f2642f47ffa82a3f686ca5224fea87c14
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Fri Nov 11 18:09:29 2011 +0200
Release strings after use
diff --git a/sal/osl/android/jni/lo-bootstrap.c b/sal/osl/android/jni/lo-bootstrap.c
index 3905c51..9f9aaa4 100644
--- a/sal/osl/android/jni/lo-bootstrap.c
+++ b/sal/osl/android/jni/lo-bootstrap.c
@@ -81,6 +81,9 @@ Java_org_libreoffice_android_Bootstrap_dlneeds( JNIEnv* env,
LOGI("dlneeds(%s)\n", libName);
fd = open (libName, O_RDONLY);
+
+ (*env)->ReleaseStringUTFChars(env, library, libName);
+
if (fd == -1) {
LOGI("Could not open library");
return NULL;
@@ -229,6 +232,7 @@ Java_org_libreoffice_android_Bootstrap_dlopen(JNIEnv* env,
const jbyte *libName = (*env)->GetStringUTFChars(env, library, NULL);
void *p = dlopen (libName, RTLD_LOCAL);
LOGI("dlopen(%s) = %p", libName, p);
+ (*env)->ReleaseStringUTFChars(env, library, libName);
if (p == NULL) {
LOGI(dlerror());
return 0;
@@ -245,6 +249,7 @@ Java_org_libreoffice_android_Bootstrap_dlsym(JNIEnv* env,
const jbyte *symName = (*env)->GetStringUTFChars(env, symbol, NULL);
void *p = dlsym ((void *)handle, symName);
LOGI("dlsym(%p,%s) = %p", handle, symName, p);
+ (*env)->ReleaseStringUTFChars(env, symbol, symName);
if (p == NULL) {
LOGI(dlerror());
return 0;
More information about the Libreoffice-commits
mailing list