diff options
author | Sven Gothel <[email protected]> | 2012-05-03 22:05:39 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-03 22:05:39 +0200 |
commit | ce9ace37ca883a844fbab7aef8c85197282442ed (patch) | |
tree | 657451f91e7efce59c3028aabb24c8a0d7f42a28 /src/java/jogamp/android/launcher/AssetDexClassLoader.java | |
parent | e058ab458bac76736e2ab125b797216fa0eb0856 (diff) |
Android Launcher: More verbose ClassLoader*
Diffstat (limited to 'src/java/jogamp/android/launcher/AssetDexClassLoader.java')
-rw-r--r-- | src/java/jogamp/android/launcher/AssetDexClassLoader.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/java/jogamp/android/launcher/AssetDexClassLoader.java b/src/java/jogamp/android/launcher/AssetDexClassLoader.java index ec3ae6c..dcc162c 100644 --- a/src/java/jogamp/android/launcher/AssetDexClassLoader.java +++ b/src/java/jogamp/android/launcher/AssetDexClassLoader.java @@ -7,14 +7,36 @@ import android.util.Log; import dalvik.system.DexClassLoader; public class AssetDexClassLoader extends DexClassLoader { - private static final boolean DEBUG = false; + private static final boolean DEBUG = true; private static final String assets_folder = "assets/"; + private static int next_id = 1; + private final int id; + public AssetDexClassLoader(String dexPath, String dexOutputDir, String libPath, ClassLoader parent) { super(dexPath, dexOutputDir, libPath, parent); + synchronized(AssetDexClassLoader.class) { + id = next_id++; + } + if(DEBUG) { + Log.d(getSimpleName(), getIdName()+".ctor: dexPath " + dexPath + ", dexOutputDir " + dexOutputDir + ", libPath " + libPath + ", parent " + parent); + } + } + + protected final String getSimpleName() { + return AssetDexClassLoader.class.getSimpleName(); + } + protected final String getIdName() { + return "ADCL["+id+"]"; + } + + @Override + public String findLibrary(String libName) { + final String res = super.findLibrary(libName); if(DEBUG) { - Log.d(AssetDexClassLoader.class.getSimpleName(), "ctor: dexPath " + dexPath + ", dexOutputDir " + dexOutputDir + ", libPath " + libPath + ", parent " + parent); + Log.d(getSimpleName(), getIdName()+".findLibrary: " + libName + " -> " + res); } + return res; } @Override @@ -22,7 +44,7 @@ public class AssetDexClassLoader extends DexClassLoader { final String assetName = name.startsWith(assets_folder) ? name : assets_folder + name ; URL url = super.findResource(assetName); if(DEBUG) { - Log.d(AssetDexClassLoader.class.getSimpleName(), "findResource: " + name + " -> " + assetName + " -> " + url); + Log.d(getSimpleName(), getIdName()+".findResource: " + name + " -> " + assetName + " -> " + url); } return url; } |