From b3c9951006f9bd863244f1db3d54ac7866d66f0a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 4 Jun 2012 04:36:52 +0200 Subject: Fix Bug 583: Remove Android compile-time dependencies and exclude Android specific classes for non Android platforms. Android specifics are delegated via class AndroidUtils, which uses reflection to call AndroidUtilsImpl if platform is Android. Android code is confined to the packages: jogamp.common.os.android.* jogamp.android.launcher.* and only included when compiled for the Android platform. --- src/java/jogamp/common/os/android/StaticContext.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/java/jogamp/common/os/android/StaticContext.java') diff --git a/src/java/jogamp/common/os/android/StaticContext.java b/src/java/jogamp/common/os/android/StaticContext.java index 055fa2f..d7f134a 100644 --- a/src/java/jogamp/common/os/android/StaticContext.java +++ b/src/java/jogamp/common/os/android/StaticContext.java @@ -36,7 +36,10 @@ public class StaticContext { private static boolean DEBUG = false; /** + * Register Android application context for static usage. + * * @param appContext mandatory application Context + * @throws RuntimeException if the context is already registered. */ public static final synchronized void init(Context appContext) { if(null != StaticContext.appContext) { @@ -45,10 +48,19 @@ public class StaticContext { if(DEBUG) { Log.d(MD.TAG, "init(appCtx "+appContext+")"); } StaticContext.appContext = appContext; } + + /** + * Unregister the Android application Context + */ public static final synchronized void clear() { if(DEBUG) { Log.d(MD.TAG, "clear()"); } appContext = null; } + + /** + * Return the registered Android application Context + * @return + */ public static final synchronized Context getContext() { return appContext; } -- cgit v1.2.3