diff options
author | Raphael Moll <ralf@android.com> | 2012-05-17 12:41:14 -0700 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2012-05-17 12:41:14 -0700 |
commit | 0d08ce04d89f8ec44c3464af20ab0c00b85c64ff (patch) | |
tree | 7682c0e6e90a79f837a49f87a2f1d309b8470b18 /sdkmanager/libs/sdkuilib/src | |
parent | 7911fa1ef67338907a2fb22d4fdb4203930a4549 (diff) | |
download | sdk-0d08ce04d89f8ec44c3464af20ab0c00b85c64ff.zip sdk-0d08ce04d89f8ec44c3464af20ab0c00b85c64ff.tar.gz sdk-0d08ce04d89f8ec44c3464af20ab0c00b85c64ff.tar.bz2 |
SDK Manager: do not erase default java http proxy properties.
If the sdk manager config file has no proxy port/host
info, do not set the corresponding java properties to
empty strings.
This means if the sdk manager settings are empty, whatever
is the default from Java OR from the Eclispe proxy settings
will be used by the manager.
Change-Id: I17bbc6faed4726fc4b6aa9b29ded7d698ed81283
Diffstat (limited to 'sdkmanager/libs/sdkuilib/src')
-rwxr-xr-x | sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java index 672feed..2d8b57e 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java @@ -288,10 +288,16 @@ public class SettingsController { final String JAVA_PROP_HTTPS_PROXY_HOST = "https.proxyHost"; //$NON-NLS-1$
final String JAVA_PROP_HTTPS_PROXY_PORT = "https.proxyPort"; //$NON-NLS-1$
- props.setProperty(JAVA_PROP_HTTP_PROXY_HOST, proxyHost);
- props.setProperty(JAVA_PROP_HTTP_PROXY_PORT, proxyPort);
- props.setProperty(JAVA_PROP_HTTPS_PROXY_HOST, proxyHost);
- props.setProperty(JAVA_PROP_HTTPS_PROXY_PORT, proxyPort);
+ // Only change the proxy if have something in the preferences.
+ // Do not erase the default settings by empty values.
+ if (proxyHost != null && proxyHost.length() > 0) {
+ props.setProperty(JAVA_PROP_HTTP_PROXY_HOST, proxyHost);
+ props.setProperty(JAVA_PROP_HTTPS_PROXY_HOST, proxyHost);
+ }
+ if (proxyPort != null && proxyPort.length() > 0) {
+ props.setProperty(JAVA_PROP_HTTP_PROXY_PORT, proxyPort);
+ props.setProperty(JAVA_PROP_HTTPS_PROXY_PORT, proxyPort);
+ }
}
}
|