aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/com/jogamp/common/os/AndroidVersion.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/java/com/jogamp/common/os/AndroidVersion.java b/src/java/com/jogamp/common/os/AndroidVersion.java
index 840933f..c2c2159 100644
--- a/src/java/com/jogamp/common/os/AndroidVersion.java
+++ b/src/java/com/jogamp/common/os/AndroidVersion.java
@@ -74,15 +74,20 @@ public class AndroidVersion {
Object abvObject= null;
Class<?> abvcClass = null;
Object abvcObject= null;
- try {
- abClass = ReflectionUtil.getClass(androidBuild, true, cl);
- abObject = abClass.newInstance();
- abvClass = ReflectionUtil.getClass(androidBuildVersion, true, cl);
- abvObject = abvClass.newInstance();
- abvcClass = ReflectionUtil.getClass(androidBuildVersionCodes, true, cl);
- abvcObject = abvcClass.newInstance();
- } catch (final Exception e) { /* n/a */ }
- isAvailable = null != abObject && null != abvObject;
+
+ boolean isDalvikVm = "Dalvik".equals(System.getProperty("java.vm.name"));
+
+ if (isDalvikVm) {
+ try {
+ abClass = ReflectionUtil.getClass(androidBuild, true, cl);
+ abObject = abClass.newInstance();
+ abvClass = ReflectionUtil.getClass(androidBuildVersion, true, cl);
+ abvObject = abvClass.newInstance();
+ abvcClass = ReflectionUtil.getClass(androidBuildVersionCodes, true, cl);
+ abvcObject = abvcClass.newInstance();
+ } catch (final Exception e) { /* n/a */ }
+ }
+ isAvailable = isDalvikVm && null != abObject && null != abvObject;
if(isAvailable) {
CPU_ABI = getString(abClass, abObject, "CPU_ABI", true);
CPU_ABI2 = getString(abClass, abObject, "CPU_ABI2", true);