Merge "Fix: ConnectivityManager is initialized with a wrong context"

This commit is contained in:
Treehugger Robot
2018-05-25 16:42:59 +00:00
committed by Gerrit Code Review

View File

@@ -964,7 +964,8 @@ public final class ActivityThread {
}
public void setHttpProxy(String host, String port, String exclList, Uri pacFileUrl) {
final ConnectivityManager cm = ConnectivityManager.from(getSystemContext());
final ConnectivityManager cm = ConnectivityManager.from(
getApplication() != null ? getApplication() : getSystemContext());
final Network network = cm.getBoundNetworkForProcess();
if (network != null) {
Proxy.setHttpProxySystemProperty(cm.getDefaultProxy());