Merge part of Sisinda work on Android branch.


git-svn-id: https://svn.apache.org/repos/asf/sis/branches/Android@1805588 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/pom.xml b/core/pom.xml
index 47dec58..c03b790 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -182,6 +182,7 @@
     <dependency>
       <groupId>com.google.android</groupId>
       <artifactId>android-test</artifactId>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>com.google.android</groupId>
diff --git a/core/sis-utility/src/main/AndroidManifest.xml b/core/sis-utility/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..3f188cc
--- /dev/null
+++ b/core/sis-utility/src/main/AndroidManifest.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="org.apache.sis.utility"
+          android:versionCode="1"
+          android:versionName="0.8-android-SNAPSHOT">
+    <uses-sdk android:minSdkVersion="26" />
+</manifest>
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/OSGiActivator.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/OSGiActivator.java
deleted file mode 100644
index 6ace496..0000000
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/system/OSGiActivator.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.internal.system;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-
-
-/**
- * Bundle activator for OSGi environment.
- * This class is declared in the {@code maven-bundle-plugin} configuration in the
- * {@code sis-utility/pom.xml} file. This class should not be used directly.
- *
- * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
- *
- * @see ServletListener
- *
- * @since 0.3
- * @module
- */
-public final class OSGiActivator implements BundleActivator, BundleListener {
-    /**
-     * Creates a new bundle activator.
-     */
-    public OSGiActivator() {
-    }
-
-    /**
-     * Invoked when this bundle is started.
-     *
-     * @param  context  the execution context of the bundle being started.
-     */
-    @Override
-    public void start(final BundleContext context) {
-        context.addBundleListener(this);
-        Shutdown.setContainer("OSGi");
-    }
-
-    /**
-     * Invoked when this bundle is stopped.
-     * This method shutdowns the {@code sis-utility} threads.
-     *
-     * @param  context  the execution context of the bundle being stopped.
-     * @throws Exception if an error occurred during unregistration of the supervisor MBean or resource disposal.
-     */
-    @Override
-    public void stop(final BundleContext context) throws Exception {
-        context.removeBundleListener(this);
-        Shutdown.stop(getClass());
-    }
-
-    /**
-     * Invoked when an other module has been installed or un-installed.
-     * This method notifies the Apache SIS library that the classpath may have changed.
-     *
-     * @param  event  the event that describe the life-cycle change.
-     */
-    @Override
-    public void bundleChanged(final BundleEvent event) {
-        switch (event.getType()) {
-            case BundleEvent.STARTED: {
-                SystemListener.fireClasspathChanged();
-                break;
-            }
-            case BundleEvent.STOPPED: {
-                SystemListener.fireClasspathChanged();
-                SystemListener.removeModule(event.getBundle().getSymbolicName());
-                break;
-            }
-        }
-    }
-}
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/ServletListener.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/ServletListener.java
deleted file mode 100644
index a6ffb48..0000000
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/system/ServletListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.internal.system;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-
-/**
- * Listener for servlet context, used as a shutdown hook when the application is undeployed.
- * This class should not be used directly.
- *
- * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
- *
- * @see OSGiActivator
- *
- * @since 0.3
- * @module
- */
-@WebListener("Apache SIS shutdown hook")
-public final class ServletListener implements ServletContextListener {
-    /**
-     * Invoked by reflection by the container.
-     */
-    public ServletListener() {
-    }
-
-    /**
-     * Receives notification that the web application initialization process is starting.
-     *
-     * @param  event  the context of the servlet being initialized.
-     */
-    @Override
-    public void contextInitialized(final ServletContextEvent event) {
-        final String env = event.getServletContext().getServerInfo();
-        Shutdown.setContainer(env != null ? env : "Servlet");
-    }
-
-    /**
-     * Receives notification that the application is about to be shutdown.
-     *
-     * @param  event  the context of the servlet being shutdown.
-     */
-    @Override
-    public void contextDestroyed(final ServletContextEvent event) {
-        try {
-            Shutdown.stop(getClass());
-        } catch (Exception e) {
-            event.getServletContext().log(e.toString(), e);
-        }
-    }
-}
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java
index c56b882..378e402 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java
@@ -94,7 +94,6 @@
 
     /**
      * Removes all listeners for the module of the given name.
-     * This method is invoked by {@link OSGiActivator}.
      *
      * @param  name  the name of the module for which to remove listeners, or {@code null} if the module
      *         to uninstall does not have symbolic name (in which case it is probably not a SIS module).
diff --git a/core/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java b/core/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java
index 345e274..e27a1a0 100644
--- a/core/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java
+++ b/core/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java
@@ -64,6 +64,6 @@
      * @return {@code true} if tests that may depend on garbage collector activity are allowed.
      */
     public static boolean allowGarbageCollectorDependentTests() {
-        return true;
+        return false;
     }
 }
diff --git a/pom.xml b/pom.xml
index b7f8eeb..d7aad0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1006,6 +1006,7 @@
   </repositories>
 
 
+
   <!-- ==============================================================
          Group of modules to build in approximate dependency order.
        ============================================================== -->