aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os/android/PackageInfoUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-06 09:47:10 +0200
committerSven Gothel <[email protected]>2011-08-06 09:47:10 +0200
commitae6b6a4ebec87be9a9dfb4df2eecb7c4e21dd37d (patch)
tree83d34d84acbfb06fe25987590e29d94825367392 /src/java/jogamp/common/os/android/PackageInfoUtil.java
parent6281499e53555fd8ab26345ffce4c4d09bf57a09 (diff)
Android: Extract static context holder
Diffstat (limited to 'src/java/jogamp/common/os/android/PackageInfoUtil.java')
-rw-r--r--src/java/jogamp/common/os/android/PackageInfoUtil.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/java/jogamp/common/os/android/PackageInfoUtil.java b/src/java/jogamp/common/os/android/PackageInfoUtil.java
index 473f262..28795a1 100644
--- a/src/java/jogamp/common/os/android/PackageInfoUtil.java
+++ b/src/java/jogamp/common/os/android/PackageInfoUtil.java
@@ -32,18 +32,13 @@ import android.content.pm.*;
import android.util.Log;
public class PackageInfoUtil {
- private static Context context = null;
private static boolean DEBUG = false;
- public static final synchronized void setContext(Context ctx) {
- if(DEBUG) Log.d(MD.TAG, "setContext("+ctx+")");
- context = ctx;
- }
- public static final synchronized Context getContext() {
- return context;
- }
public static final PackageInfo getPackageInfo(String packageName) {
- Context ctx = getContext();
+ return getPackageInfo(StaticContext.getContext(), packageName);
+ }
+
+ public static final PackageInfo getPackageInfo(Context ctx, String packageName) {
if(null != ctx) {
try {
final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA);