diff options
author | Sven Gothel <[email protected]> | 2011-08-03 11:56:40 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-08-03 11:56:40 +0200 |
commit | e659f5994875275d4eb46e745676a3d84e27d1e9 (patch) | |
tree | aa8bd6bdcb2a02f1c8fc0b2f89aba0aac6160229 /src/java | |
parent | d30d6548baa4fa18c55eb4f9087bca5700463a51 (diff) |
Hide DynamicLinker impl.; Remove public AndroidPackageUtil ; GluegenVersionActivity uses ApplicationContext
Hide DynamicLinker impl.:
- com.jogamp.common.os.*DynamicLinkerImpl -> jogamp.common.os
Diffstat (limited to 'src/java')
-rwxr-xr-x | src/java/com/jogamp/common/os/DynamicLinker.java | 2 | ||||
-rwxr-xr-x | src/java/com/jogamp/common/os/NativeLibrary.java | 4 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/AndroidPackageUtil.java | 59 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/JogampVersion.java | 9 | ||||
-rwxr-xr-x | src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java (renamed from src/java/com/jogamp/common/os/MacOSXDynamicLinkerImpl.java) | 4 | ||||
-rwxr-xr-x | src/java/jogamp/common/os/UnixDynamicLinkerImpl.java (renamed from src/java/com/jogamp/common/os/UnixDynamicLinkerImpl.java) | 4 | ||||
-rwxr-xr-x | src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java (renamed from src/java/com/jogamp/common/os/WindowsDynamicLinkerImpl.java) | 4 | ||||
-rw-r--r-- | src/java/jogamp/common/os/android/GluegenVersionActivity.java | 4 |
8 files changed, 24 insertions, 66 deletions
diff --git a/src/java/com/jogamp/common/os/DynamicLinker.java b/src/java/com/jogamp/common/os/DynamicLinker.java index d67a38f..924a776 100755 --- a/src/java/com/jogamp/common/os/DynamicLinker.java +++ b/src/java/com/jogamp/common/os/DynamicLinker.java @@ -42,7 +42,7 @@ package com.jogamp.common.os; /** Provides an abstract interface to the OS's low-level dynamic linking functionality. */ -interface DynamicLinker { +public interface DynamicLinker { public long openLibraryGlobal(String pathname, boolean debug); public long openLibraryLocal(String pathname, boolean debug); public long lookupSymbol(long libraryHandle, String symbolName); diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index 47c73e6..1df0e61 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -41,6 +41,10 @@ package com.jogamp.common.os; import com.jogamp.gluegen.runtime.NativeLibLoader; import jogamp.common.Debug; +import jogamp.common.os.MacOSXDynamicLinkerImpl; +import jogamp.common.os.UnixDynamicLinkerImpl; +import jogamp.common.os.WindowsDynamicLinkerImpl; + import java.io.*; import java.lang.reflect.*; import java.security.*; diff --git a/src/java/com/jogamp/common/util/AndroidPackageUtil.java b/src/java/com/jogamp/common/util/AndroidPackageUtil.java deleted file mode 100644 index 86b25dd..0000000 --- a/src/java/com/jogamp/common/util/AndroidPackageUtil.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright 2011 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ - -package com.jogamp.common.util; - -import java.lang.reflect.Method; - -public class AndroidPackageUtil { - - static final Method androidPackageInfoUtilGetVersionName; - static final boolean androidPackageInfoUtilAvailable; - static { - final ClassLoader cl = AndroidPackageUtil.class.getClassLoader(); - Method m=null; - try { - final Class c = ReflectionUtil.getClass("jogamp.common.os.android.PackageInfoUtil", true, cl); - m = ReflectionUtil.getMethod(c, "getPackageInfoVersionName", String.class); - } catch (Exception e) { /* n/a */ } - androidPackageInfoUtilGetVersionName = m; - androidPackageInfoUtilAvailable = null != m ; - } - - public static boolean isAndroidPackageInfoAvailable() { - return androidPackageInfoUtilAvailable; - } - - public static String getAndroidPackageInfoVersionName(String packageName) { - if(androidPackageInfoUtilAvailable) { - return (String) ReflectionUtil.callMethod(null, androidPackageInfoUtilGetVersionName, packageName); - } - return null; - } -} - diff --git a/src/java/com/jogamp/common/util/JogampVersion.java b/src/java/com/jogamp/common/util/JogampVersion.java index a2b1e2f..2461c3e 100644 --- a/src/java/com/jogamp/common/util/JogampVersion.java +++ b/src/java/com/jogamp/common/util/JogampVersion.java @@ -29,6 +29,7 @@ package com.jogamp.common.util; import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.AndroidVersion; import com.jogamp.common.os.Platform; import java.util.Iterator; @@ -36,6 +37,8 @@ import java.util.Set; import java.util.jar.Attributes; import java.util.jar.Manifest; +import jogamp.common.os.android.PackageInfoUtil; + public class JogampVersion { public static final Attributes.Name IMPLEMENTATION_BRANCH = new Attributes.Name("Implementation-Branch"); @@ -55,7 +58,11 @@ public class JogampVersion { this.hash = this.mf.hashCode(); mainAttributes = this.mf.getMainAttributes(); mainAttributeNames = mainAttributes.keySet(); - androidPackageVersionName = AndroidPackageUtil.getAndroidPackageInfoVersionName(packageName); + if(AndroidVersion.isAvailable) { + androidPackageVersionName = PackageInfoUtil.getPackageInfoVersionName(packageName); + } else { + androidPackageVersionName = null; + } } @Override diff --git a/src/java/com/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java index 0e71d5d..c1be2c2 100755 --- a/src/java/com/jogamp/common/os/MacOSXDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java @@ -1,6 +1,8 @@ /* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:27:00 PDT 2006 ----! */ -package com.jogamp.common.os; +package jogamp.common.os; + +import com.jogamp.common.os.DynamicLinker; public class MacOSXDynamicLinkerImpl implements DynamicLinker { diff --git a/src/java/com/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java index fcfe418..677df32 100755 --- a/src/java/com/jogamp/common/os/UnixDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java @@ -1,6 +1,8 @@ /* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:26:59 PDT 2006 ----! */ -package com.jogamp.common.os; +package jogamp.common.os; + +import com.jogamp.common.os.DynamicLinker; public class UnixDynamicLinkerImpl implements DynamicLinker { diff --git a/src/java/com/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java index 7bbfe23..09f38df 100755 --- a/src/java/com/jogamp/common/os/WindowsDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java @@ -1,9 +1,11 @@ /* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Tue May 27 02:37:55 PDT 2008 ----! */ -package com.jogamp.common.os; +package jogamp.common.os; import java.security.*; +import com.jogamp.common.os.DynamicLinker; + public class WindowsDynamicLinkerImpl implements DynamicLinker { private static boolean DEBUG; diff --git a/src/java/jogamp/common/os/android/GluegenVersionActivity.java b/src/java/jogamp/common/os/android/GluegenVersionActivity.java index 34c6fb5..16222b6 100644 --- a/src/java/jogamp/common/os/android/GluegenVersionActivity.java +++ b/src/java/jogamp/common/os/android/GluegenVersionActivity.java @@ -43,7 +43,7 @@ public class GluegenVersionActivity extends Activity { public void onCreate(Bundle savedInstanceState) { Log.d(MD.TAG, "onCreate - S"); super.onCreate(savedInstanceState); - PackageInfoUtil.setContext(this); + PackageInfoUtil.setContext(this.getApplicationContext()); tv = new TextView(this); tv.setText(VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+Platform.NEWLINE); setContentView(tv); @@ -108,8 +108,8 @@ public class GluegenVersionActivity extends Activity { if(null != tv) { tv.append("> destroyed"+Platform.NEWLINE); } - PackageInfoUtil.setContext(null); Log.d(MD.TAG, "onDestroy - x"); + PackageInfoUtil.setContext(null); super.onDestroy(); Log.d(MD.TAG, "onDestroy - X"); } |