From faf75243275d4aca158249a5ef73d0cc942b0825 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 23 May 2017 17:38:12 +0300 Subject: [PATCH] Fix #3799 --- OsmAnd/src/net/osmand/plus/OsmandApplication.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 4f9e0633cd..ff36da0a5f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -14,6 +14,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Message; +import android.preference.PreferenceManager; import android.support.multidex.MultiDex; import android.support.multidex.MultiDexApplication; import android.support.v7.app.AlertDialog; @@ -28,11 +29,11 @@ import net.osmand.CallbackWithObject; import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityPlugin; import net.osmand.aidl.OsmandAidlApi; -import net.osmand.aidl.OsmandAidlService; import net.osmand.data.LatLon; import net.osmand.map.OsmandRegions; import net.osmand.map.WorldRegion; import net.osmand.osm.MapPoiTypes; +import net.osmand.osm.io.NetworkUtils; import net.osmand.plus.AppInitializer.AppInitializeListener; import net.osmand.plus.access.AccessibilityMode; import net.osmand.plus.activities.DayNightHelper; @@ -144,6 +145,9 @@ public class OsmandApplication extends MultiDexApplication { appCustomization.setup(this); osmandSettings = appCustomization.getOsmandSettings(); appInitializer.initVariables(); + if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("enable_proxy", false)) { + NetworkUtils.setProxy(osmandSettings.PROXY_HOST.get(), osmandSettings.PROXY_PORT.get()); + } if (appInitializer.isAppVersionChanged() && appInitializer.getPrevAppVersion() < AppInitializer.VERSION_2_3) { osmandSettings.freezeExternalStorageDirectory(); } else if (appInitializer.isFirstTime()) {