Merge "Fix: ConnectivityManager is initialized with a wrong context" into pi-dev
This commit is contained in:
@@ -939,7 +939,8 @@ public final class ActivityThread extends ClientTransactionHandler {
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user