Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e401d17d authored by Paul Jensen's avatar Paul Jensen
Browse files

Allow libcore to perform necessary actions upon net config changes.

Delegate to libcore the responsibility of performing the necessary
actions upon a network configuration change, such as a DNS
configuration change.  In the L-release, these responsibilities
now include flushing the HTTP connection pools to prevent connections
on lingering networks getting pulled from the pool inadvertently to
satisfy requests that should be going over the new network.  All such
responsibilities can now be controlled and delegated by libcore's
new NetworkEventDispatcher, designed for this purpose.

bug:17314604
Change-Id: Ic796aea9d9a1f6ecb787fbdb38b3b7f5d991829b
parent d7fcca95
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ import java.util.regex.Pattern;
import libcore.io.DropBox;
import libcore.io.EventLogger;
import libcore.io.IoUtils;
import libcore.net.event.NetworkEventDispatcher;

import dalvik.system.CloseGuard;
import dalvik.system.VMDebug;
@@ -827,6 +828,9 @@ public final class ActivityThread {
        public void clearDnsCache() {
            // a non-standard API to get this to libcore
            InetAddress.clearDnsCache();
            // Allow libcore to perform the necessary actions as it sees fit upon a network
            // configuration change.
            NetworkEventDispatcher.getInstance().onNetworkConfigurationChanged();
        }

        public void setHttpProxy(String host, String port, String exclList, Uri pacFileUrl) {