README.cross | 12 ------ android/Bootstrap/src/org/libreoffice/android/Bootstrap.java | 22 +++++++++-- android/qa/sc/Makefile | 4 +- 3 files changed, 22 insertions(+), 16 deletions(-)
New commits: commit 11c9125c28738ce99e502991523829756ec95326 Author: Tor Lillqvist <tlillqv...@suse.com> Date: Wed Jan 11 13:46:35 2012 +0200 Work around http://code.google.com/p/android/issues/detail?id=23351 diff --git a/README.cross b/README.cross index 709838b..45e1888 100644 --- a/README.cross +++ b/README.cross @@ -395,18 +395,6 @@ window, and you probably also want to have set the stdout and stderr of app processes to be redirected to logcat ("adb shell stop; adb shell setprop log.redirect-stdio true; adb shell start"). -Unfortunately you might notice that the command line passed to "adb -shell am start" is too long (actually, not "command line" as such, but -the length of the so-called "extra" arguments passed to the action, or -something like that, see Android bug -http://code.google.com/p/android/issues/detail?id=23351 , so you need -to shorten it somehow... for instance by creating a symlink to -/data/data/org.libreoffice.android.qa.sc in /system: "adb remount; adb -shell ln -s /data/data/org.libreoffice.android.qa.sc /system/sc" and -then use that shorter path /system/sc snippet in all places instead of -the longer /data/data/org.libreoffice.android.qa.sc on the "adb shell -am start" command line. - To debug, do manually what "make run" would do, adding args "-e lo-main-delay 20" to the command line, and when the app has started, run ndk-gdb. Unfortunately the gdb in NDK r7 is broken, use the one in diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java index 91f965e..9cd9c3b 100644 --- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java +++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java @@ -37,6 +37,9 @@ import android.util.Log; import fi.iki.tml.CommandLine; +import java.io.File; +import java.util.Scanner; + // We override NativeActivity so that we can get at the intent of the // activity and its extra parameters, that we use to tell us what // actual LibreOffice "program" to run. I.e. something that on desktop @@ -111,9 +114,22 @@ public class Bootstrap extends NativeActivity // Get "command line" to pass to the LO "program" String cmdLine = getIntent().getStringExtra("lo-main-cmdline"); - if (cmdLine == null) - cmdLine = "/data/data/org.libreoffice.android/lib/libqa_sal_types.so"; - + if (cmdLine == null) { + String indirectFile = getIntent().getStringExtra("lo-main-indirect-cmdline"); + + if (indirectFile != null) { + try { + // Somewhat stupid but short way to read a file into a string + cmdLine = new Scanner(new File(indirectFile), "UTF-8").useDelimiter("\\A").next(); + } + catch (java.io.FileNotFoundException e) { + Log.i(TAG, String.format("Could not read %s: %s",indirectFile, e.toString())); + } + } + + if (cmdLine == null) + cmdLine = "/data/data/org.libreoffice.android/lib/libqa_sal_types.so"; + } // argv[0] will be replaced by android_main() in lo-bootstrap.c by the // pathname of the mainLibrary. cmdLine = "dummy-program-name " + cmdLine; diff --git a/android/qa/sc/Makefile b/android/qa/sc/Makefile index 450b7ed..c400c72 100644 --- a/android/qa/sc/Makefile +++ b/android/qa/sc/Makefile @@ -162,7 +162,9 @@ uninstall: adb uninstall $(APP_PACKAGE) run: - adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-library libcppunittester -e lo-main-cmdline "$(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector '-env:CONFIGURATION_LAYERS=xcsxcu:file:///assets/xml/registry' '-env:UNO_TYPES=file:///assets/bin/udkapi.rdb file:///assets/bin/types.rdb' '-env:UNO_SERVICES=file:///assets/xml/ure/services.rdb file:///assets/ComponentTarget/framework/util/fwk.component file:///assets/ComponentTarget/i18npool/util/i18npool.component file:///assets/ComponentTarget/sfx2/util/sfx.component file:///assets/ComponentTarget/unoxml/source/service/unoxml.component file:///assets/ComponentTarget/configmgr/source/configmgr.component file:///assets/xml/ucb1.component file:///assets/xml/ucpfile1.component' -env:URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib -env:LO_LIB_DIR=file://$(APP_DATA_PATH)/lib" + echo "$(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector '-env:CONFIGURATION_LAYERS=xcsxcu:file:///assets/xml/registry' '-env:UNO_TYPES=file:///assets/bin/udkapi.rdb file:///assets/bin/types.rdb' '-env:UNO_SERVICES=file:///assets/xml/ure/services.rdb file:///assets/ComponentTarget/framework/util/fwk.component file:///assets/ComponentTarget/i18npool/util/i18npool.component file:///assets/ComponentTarget/sfx2/util/sfx.component file:///assets/ComponentTarget/unoxml/source/service/unoxml.component file:///assets/ComponentTarget/configmgr/source/configmgr.component file:///assets/xml/ucb1.component file:///assets/xml/ucpfile1.component' -env:URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib -env:LO_LIB_DIR=file://$(APP_DATA_PATH)/lib" >cmdline + adb push cmdline $(APP_DATA_PATH)/cmdline + adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-library libcppunittester -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline" clean: ant clean _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits