diff --git a/app/src/main/java/org/blitzortung/android/app/Main.kt b/app/src/main/java/org/blitzortung/android/app/Main.kt index 651d5c00..587fd5ae 100644 --- a/app/src/main/java/org/blitzortung/android/app/Main.kt +++ b/app/src/main/java/org/blitzortung/android/app/Main.kt @@ -18,7 +18,6 @@ package org.blitzortung.android.app -import MapConfigurationProvider import android.Manifest.permission.* import android.annotation.TargetApi import android.content.Context @@ -246,7 +245,6 @@ class Main : FragmentActivity(), OnSharedPreferenceChangeListener { } private fun initializeOsmDroid() { - Configuration.setConfigurationProvider(MapConfigurationProvider(applicationContext)) val osmDroidConfig = Configuration.getInstance() osmDroidConfig.load(this, preferences) Log.v(LOG_TAG, "Main.onCreate() osmdroid base ${osmDroidConfig.osmdroidBasePath} tiles ${osmDroidConfig.osmdroidTileCache}, size: ${osmDroidConfig.osmdroidTileCache.length()}") diff --git a/app/src/main/java/org/blitzortung/android/app/MapConfigurationProvider.kt b/app/src/main/java/org/blitzortung/android/app/MapConfigurationProvider.kt deleted file mode 100644 index 457c9d5d..00000000 --- a/app/src/main/java/org/blitzortung/android/app/MapConfigurationProvider.kt +++ /dev/null @@ -1,33 +0,0 @@ - -import android.content.Context -import android.os.Environment -import android.util.Log -import org.osmdroid.api.IMapView -import org.osmdroid.config.DefaultConfigurationProvider -import org.osmdroid.tileprovider.util.StorageUtils -import java.io.File - - -class MapConfigurationProvider(private val context: Context) : DefaultConfigurationProvider() { - override fun getOsmdroidBasePath(context: Context?): File? { - try { - if (osmdroidBasePath == null) { - val storageInfo: StorageUtils.StorageInfo? = StorageUtils.getBestWritableStorage(context) - if (storageInfo != null) { - val pathToStorage = storageInfo.path - osmdroidBasePath = File(pathToStorage, "osmdroid") - osmdroidBasePath.mkdirs() - } else { - osmdroidBasePath = File((context ?: this.context).getExternalFilesDir( - Environment.DIRECTORY_PICTURES), "osmdroid") - if (!osmdroidBasePath.mkdirs()) { - Log.e(IMapView.LOGTAG, "Directory not created") - } - } - } - } catch (ex: Exception) { - Log.d(IMapView.LOGTAG, "Unable to create base path at $osmdroidBasePath", ex) - } - return osmdroidBasePath - } -} \ No newline at end of file