From 45f0c5d6dab2a8c5deacac1eee6fc1aca25a4f26 Mon Sep 17 00:00:00 2001 From: mtehver Date: Fri, 7 Oct 2022 10:32:04 +0300 Subject: [PATCH] Remove unnecessary code from Android MapView --- android/java/com/carto/ui/MapView.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/android/java/com/carto/ui/MapView.java b/android/java/com/carto/ui/MapView.java index 9baf854d1..359491a62 100644 --- a/android/java/com/carto/ui/MapView.java +++ b/android/java/com/carto/ui/MapView.java @@ -137,7 +137,7 @@ public MapView(Context context, AttributeSet attrs) { setLongClickable(longClickable); if (!isInEditMode()) { - // Connect context info and assets manager to native part + // Connect context info and asset manager to native part AndroidUtils.setContext(context); if (assetManager == null) { com.carto.utils.Log.warn("MapView: MapView created before MapView.registerLicense is called"); @@ -145,15 +145,13 @@ public MapView(Context context, AttributeSet attrs) { assetManager = context.getApplicationContext().getAssets(); AssetUtils.setAssetManagerPointer(assetManager); } - - // Set asset manager pointer to allow native access to assets - assetManager = context.getApplicationContext().getAssets(); - AssetUtils.setAssetManagerPointer(assetManager); - + + // Initialize native BaseMapView instance baseMapView = new BaseMapView(); baseMapView.getOptions().setDPI(getResources().getDisplayMetrics().densityDpi); baseMapView.setRedrawRequestListener(new MapRedrawRequestListener(this)); - + + // Set up relevant EGL state try { Method m = GLSurfaceView.class.getMethod("setPreserveEGLContextOnPause", Boolean.TYPE); m.invoke(this, true);