Notify all VMs when proxy changes.

bug:2700664
Change-Id: I74cc6e0bd6e66847bf18f524ce851e3e9d2c4e87
This commit is contained in:
Robert Greenwalt
2010-10-11 16:00:27 -07:00
parent 5af53d4363
commit 434203a277
15 changed files with 498 additions and 302 deletions

View File

@@ -1757,10 +1757,19 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
// Remove white spaces
proxySpec = proxySpec.trim();
String data[] = proxySpec.split(":");
int proxyPort = 8080;
if (data.length > 1) {
try {
proxyPort = Integer.parseInt(data[1]);
} catch (NumberFormatException e) {}
}
exclusionList = exclusionList.trim();
ContentResolver res = mContext.getContentResolver();
Settings.Secure.putString(res, Settings.Secure.HTTP_PROXY, proxySpec);
Settings.Secure.putString(res, Settings.Secure.HTTP_PROXY_EXCLUSION_LIST, exclusionList);
Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST, data[0]);
Settings.Secure.putInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, proxyPort);
Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
exclusionList);
}
@Override