Merge "Fix: ConnectivityManager is initialized with a wrong context"
am: 4517eacd5d
Change-Id: I0629b33b8cc5e155b4500cc15901985dbf0a31f2
This commit is contained in:
@@ -964,7 +964,8 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setHttpProxy(String host, String port, String exclList, Uri pacFileUrl) {
|
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();
|
final Network network = cm.getBoundNetworkForProcess();
|
||||||
if (network != null) {
|
if (network != null) {
|
||||||
Proxy.setHttpProxySystemProperty(cm.getDefaultProxy());
|
Proxy.setHttpProxySystemProperty(cm.getDefaultProxy());
|
||||||
|
|||||||
Reference in New Issue
Block a user