From c89ef5ecd7383ff23c36297976d507f14f16c7df Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Thu, 16 May 2013 18:46:52 +0300 Subject: [PATCH] Activates JavaUtilLoggingConfig used in android. --- .../sip/communicator/util/UtilActivator.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/net/java/sip/communicator/util/UtilActivator.java b/src/net/java/sip/communicator/util/UtilActivator.java index 328d2f6d5..ed31fcd6d 100644 --- a/src/net/java/sip/communicator/util/UtilActivator.java +++ b/src/net/java/sip/communicator/util/UtilActivator.java @@ -17,6 +17,7 @@ import org.jitsi.service.fileaccess.*; import org.jitsi.service.neomedia.*; import org.jitsi.service.resources.*; +import org.jitsi.util.*; import org.osgi.framework.*; /** @@ -67,14 +68,31 @@ public class UtilActivator public void start(BundleContext context) throws Exception { - if (logger.isTraceEnabled()) - logger.trace("Setting default uncaught exception handler."); - bundleContext = context; + if(OSUtils.IS_ANDROID) + loadLoggingConfig(); + + if (logger.isTraceEnabled()) + logger.trace("Setting default uncaught exception handler."); Thread.setDefaultUncaughtExceptionHandler(this); } + /** + * Loads logging config if any. Need to be loaded in order to activate + * logging and need to be activated after bundle context is initialized. + */ + private void loadLoggingConfig() + { + try + { + Class.forName( + "net.java.sip.communicator.util.JavaUtilLoggingConfig") + .newInstance(); + } + catch(Throwable t){} + } + /** * Method invoked when a thread would terminate due to the given uncaught * exception. All we do here is simply log the exception using the system