Loading services/core/java/com/android/server/ConnectivityService.java +6 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,7 @@ public class ConnectivityService extends IConnectivityManager.Stub private class LegacyTypeTracker { private static final boolean DBG = true; private static final boolean VDBG = false; private static final boolean VDBG = true; /** * Array of lists, one per legacy network type (e.g., TYPE_MOBILE_MMS). Loading Loading @@ -2337,6 +2337,11 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public void handleMessage(Message msg) { if (VDBG) { log(String.format("handleMessage >%s<", eventName(msg.what))); } if (!maybeHandleAsyncChannelMessage(msg) && !maybeHandleNetworkMonitorMessage(msg) && !maybeHandleNetworkAgentInfoMessage(msg)) { Loading services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * Copyright (C) 2019 e.foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -46,6 +47,8 @@ import java.util.Objects; import java.util.SortedSet; import java.util.TreeSet; import java.net.InetAddress; /** * A bag class used by ConnectivityService for holding a collection of most recent * information published by a particular NetworkAgent as well as the Loading Loading @@ -252,6 +255,28 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> { asyncChannel = ac; network = net; networkInfo = info; int useNwDNS = android.provider.Settings.System.getInt(mContext.getContentResolver(), "USE_NETWORK_DNS", 1); if ( 0 != useNwDNS ) { } else { java.util.Collection<InetAddress> dnses = new java.util.ArrayList<InetAddress>(); try { String s = android.provider.Settings.System.getString(mContext.getContentResolver(), "OVERRIDE_DNS_IP_V4"); if (s == null) s = "9.9.9.9"; //if (DBG) log("Override dnses>"+s+"<"); InetAddress addr = InetAddress.getByName(s); dnses.add(addr); lp.setDnsServers(dnses); lp.setDomains(""); } catch (Exception e) { //loge("Cannot set custom DNS: " + e); } } linkProperties = lp; networkCapabilities = nc; currentScore = score; Loading Loading
services/core/java/com/android/server/ConnectivityService.java +6 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,7 @@ public class ConnectivityService extends IConnectivityManager.Stub private class LegacyTypeTracker { private static final boolean DBG = true; private static final boolean VDBG = false; private static final boolean VDBG = true; /** * Array of lists, one per legacy network type (e.g., TYPE_MOBILE_MMS). Loading Loading @@ -2337,6 +2337,11 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public void handleMessage(Message msg) { if (VDBG) { log(String.format("handleMessage >%s<", eventName(msg.what))); } if (!maybeHandleAsyncChannelMessage(msg) && !maybeHandleNetworkMonitorMessage(msg) && !maybeHandleNetworkAgentInfoMessage(msg)) { Loading
services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * Copyright (C) 2019 e.foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -46,6 +47,8 @@ import java.util.Objects; import java.util.SortedSet; import java.util.TreeSet; import java.net.InetAddress; /** * A bag class used by ConnectivityService for holding a collection of most recent * information published by a particular NetworkAgent as well as the Loading Loading @@ -252,6 +255,28 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> { asyncChannel = ac; network = net; networkInfo = info; int useNwDNS = android.provider.Settings.System.getInt(mContext.getContentResolver(), "USE_NETWORK_DNS", 1); if ( 0 != useNwDNS ) { } else { java.util.Collection<InetAddress> dnses = new java.util.ArrayList<InetAddress>(); try { String s = android.provider.Settings.System.getString(mContext.getContentResolver(), "OVERRIDE_DNS_IP_V4"); if (s == null) s = "9.9.9.9"; //if (DBG) log("Override dnses>"+s+"<"); InetAddress addr = InetAddress.getByName(s); dnses.add(addr); lp.setDnsServers(dnses); lp.setDomains(""); } catch (Exception e) { //loge("Cannot set custom DNS: " + e); } } linkProperties = lp; networkCapabilities = nc; currentScore = score; Loading