Merge pull request #4531 from osmandapp/proxy_fix

Fix #4339
This commit is contained in:
Alexey 2017-10-09 13:32:01 +03:00 committed by GitHub
commit 9386670531

View file

@ -146,9 +146,6 @@ public class OsmandApplication extends MultiDexApplication {
appCustomization.setup(this);
osmandSettings = appCustomization.getOsmandSettings();
appInitializer.initVariables();
if (osmandSettings.ENABLE_PROXY.get()) {
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()) {
@ -552,6 +549,9 @@ public class OsmandApplication extends MultiDexApplication {
if (!(uncaughtExceptionHandler instanceof DefaultExceptionHandler)) {
Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler());
}
if (NetworkUtils.getProxy() == null && osmandSettings.ENABLE_PROXY.get()) {
NetworkUtils.setProxy(osmandSettings.PROXY_HOST.get(), osmandSettings.PROXY_PORT.get());
}
appInitializer.startApplication();
}