summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-01-05 13:47:13 +0100
committerTobrun <tobrun@mapbox.com>2018-01-05 14:54:07 +0100
commitbfa4cea24c2ab3973f845fda6da6d4a9e8f03e56 (patch)
treed7a0cd759dffcf5981ee6d5d44838aa9e5d0f1d6
parentad28542e77b3680acbf40182d435c0cac926a369 (diff)
downloadqtlocation-mapboxgl-bfa4cea24c2ab3973f845fda6da6d4a9e8f03e56.tar.gz
[android] - detect genymotion virtual machines when determening attributes for eglConfig
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java
index b6f467708f..247ffea906 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.maps.renderer.egl;
import android.opengl.GLSurfaceView;
+import android.os.Build;
import android.support.annotation.NonNull;
import java.util.ArrayList;
@@ -261,9 +262,8 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser {
return attributevalue[0];
}
-
private int[] getConfigAttributes() {
- boolean emulator = inEmulator();
+ boolean emulator = inEmulator() || inGenymotion();
Timber.i("In emulator: %s", emulator);
// Get all configs at least RGB 565 with 16 depth and 8 stencil
@@ -290,4 +290,12 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser {
private boolean inEmulator() {
return System.getProperty("ro.kernel.qemu") != null;
}
+
+ /**
+ * Detect if we are in genymotion
+ */
+ private boolean inGenymotion() {
+ return Build.MANUFACTURER.contains("Genymotion");
+ }
+
}