From 10e9a3c5b05154be1994ba2b2b28b5bc3ca132b1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 11 Nov 2011 22:43:57 +0200 Subject: [PATCH] Intermediate Android commit --- .../org/libreoffice/android/Bootstrap.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sal/osl/android/src/org/libreoffice/android/Bootstrap.java b/sal/osl/android/src/org/libreoffice/android/Bootstrap.java index ba004e190914..8a1632f4ea62 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); } }