diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-26 22:33:11 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-26 23:48:54 +0200 |
commit | d2a640d69e73f30fb55e119168e47d66dd0a1a41 (patch) | |
tree | 9dfca81a0c2dbcbfd2bc80f9f4d00c05e74918ce /android | |
parent | e4bad391fc76126d7e1da7b79a86020748700921 (diff) |
Make it easier to debug the app by sleeping for a while if a property is set
If the property log.tag.LODesktopSleepOnCreate is set to "VERBOSE" then sleep
after liblo-native-code.so has been loaded to give the developer a chance to
start ndk-gdb and set breakpoints. Yeah, a bit silly to overload a logging
property like this, but it was the first idea I came up with.
Change-Id: I665f87778d083d2d167a5d16f24e2d50b1fba042
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java index c47aaea346bd..a3eb4d64dcc9 100644 --- a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java +++ b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java @@ -80,9 +80,6 @@ public class Desktop // Avoid all the old style OSL_TRACE calls especially in vcl Bootstrap.putenv("SAL_LOG=+WARN+INFO"); - // Log.i(TAG, "Sleeping NOW"); - // Thread.sleep(20000); - bootstrapContext.componentContext = com.sun.star.comp.helper.Bootstrap.defaultBootstrap_InitialComponentContext(); Log.i(TAG, "context is" + (bootstrapContext.componentContext!=null ? " not" : "") + " null"); @@ -120,6 +117,21 @@ public class Desktop Bootstrap.setCommandArgs(argv); + // To enable the sleep below, do: "adb shell setprop + // log.tag.LODesktopSleepOnCreate VERBOSE". Yeah, has + // nothing to do with logging as such. + + // This should be after at least one call to something in + // the Bootstrap class as it is the static initialiser + // that loads the lo-native-code library, and presumably + // in ndk-gdb you want to set a breapoint in some native + // code... + + if (Log.isLoggable("LODesktopSleepOnCreate", Log.VERBOSE)) { + Log.i(TAG, "Sleeping, start ndk-gdb NOW if you intend to debug"); + Thread.sleep(20000); + } + if (bootstrapContext == null) initBootstrapContext(); |