Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -619,6 +619,7 @@ filegroup { "core/java/com/android/internal/util/Preconditions.java", "core/java/com/android/internal/util/State.java", "core/java/com/android/internal/util/StateMachine.java", "core/java/com/android/internal/util/TrafficStatsConstants.java", "core/java/android/net/shared/Inet4AddressUtils.java", ], } Loading packages/Tethering/jarjar-rules.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ rule com.android.internal.util.MessageUtils* com.android.networkstack.tethering. rule com.android.internal.util.Preconditions* com.android.networkstack.tethering.util.Preconditions@1 rule com.android.internal.util.State* com.android.networkstack.tethering.util.State@1 rule com.android.internal.util.StateMachine* com.android.networkstack.tethering.util.StateMachine@1 rule com.android.internal.util.TrafficStatsConstants* com.android.networkstack.tethering.util.TrafficStatsConstants@1 rule android.net.LocalLog* com.android.networkstack.tethering.LocalLog@1 Loading packages/Tethering/src/android/net/ip/RouterAdvertisementDaemon.java +1 −1 Original line number Diff line number Diff line Loading @@ -668,7 +668,7 @@ public class RouterAdvertisementDaemon { } private final class UnicastResponder extends Thread { private final InetSocketAddress mSolicitor = new InetSocketAddress(); private final InetSocketAddress mSolicitor = new InetSocketAddress(0); // The recycled buffer for receiving Router Solicitations from clients. // If the RS is larger than IPV6_MIN_MTU the packets are truncated. // This is fine since currently only byte 0 is examined anyway. Loading packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java +8 −11 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ import android.net.LinkAddress; import android.net.LinkProperties; import android.net.Network; import android.net.NetworkInfo; import android.net.NetworkUtils; import android.net.TetherStatesParcel; import android.net.TetheringConfigurationParcel; import android.net.ip.IpServer; Loading Loading @@ -291,13 +290,6 @@ public class Tethering { filter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); filter.addAction(UserManager.ACTION_USER_RESTRICTIONS_CHANGED); mContext.registerReceiver(mStateReceiver, filter, null, handler); filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SHARED); filter.addAction(Intent.ACTION_MEDIA_UNSHARED); filter.addDataScheme("file"); mContext.registerReceiver(mStateReceiver, filter, null, handler); } private class TetheringThreadExecutor implements Executor { Loading Loading @@ -1384,12 +1376,17 @@ public class Tethering { protected void setDnsForwarders(final Network network, final LinkProperties lp) { // TODO: Set v4 and/or v6 DNS per available connectivity. String[] dnsServers = mConfig.defaultIPv4DNS; final Collection<InetAddress> dnses = lp.getDnsServers(); // TODO: Properly support the absence of DNS servers. final String[] dnsServers; if (dnses != null && !dnses.isEmpty()) { // TODO: remove this invocation of NetworkUtils.makeStrings(). dnsServers = NetworkUtils.makeStrings(dnses); dnsServers = new String[dnses.size()]; int i = 0; for (InetAddress dns : dnses) { dnsServers[i++] = dns.getHostAddress(); } } else { dnsServers = mConfig.defaultIPv4DNS; } final int netId = (network != null) ? network.netId : NETID_UNSET; try { Loading packages/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java +13 −25 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import static com.android.internal.R.string.config_mobile_hotspot_provision_app_ import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.TetheringConfigurationParcel; import android.net.util.SharedLog; import android.provider.Settings; Loading Loading @@ -179,8 +178,8 @@ public class TetheringConfiguration { pw.print("chooseUpstreamAutomatically: "); pw.println(chooseUpstreamAutomatically); dumpStringArray(pw, "preferredUpstreamIfaceTypes", preferredUpstreamNames(preferredUpstreamIfaceTypes)); pw.print("legacyPreredUpstreamIfaceTypes: "); pw.println(Arrays.toString(toIntArray(preferredUpstreamIfaceTypes))); dumpStringArray(pw, "legacyDhcpRanges", legacyDhcpRanges); dumpStringArray(pw, "defaultIPv4DNS", defaultIPv4DNS); Loading @@ -205,7 +204,7 @@ public class TetheringConfiguration { sj.add(String.format("isDunRequired:%s", isDunRequired)); sj.add(String.format("chooseUpstreamAutomatically:%s", chooseUpstreamAutomatically)); sj.add(String.format("preferredUpstreamIfaceTypes:%s", makeString(preferredUpstreamNames(preferredUpstreamIfaceTypes)))); toIntArray(preferredUpstreamIfaceTypes))); sj.add(String.format("provisioningApp:%s", makeString(provisioningApp))); sj.add(String.format("provisioningAppNoUi:%s", provisioningAppNoUi)); sj.add(String.format("enableLegacyDhcpServer:%s", enableLegacyDhcpServer)); Loading Loading @@ -234,21 +233,6 @@ public class TetheringConfiguration { return sj.toString(); } private static String[] preferredUpstreamNames(Collection<Integer> upstreamTypes) { String[] upstreamNames = null; if (upstreamTypes != null) { upstreamNames = new String[upstreamTypes.size()]; int i = 0; for (Integer netType : upstreamTypes) { upstreamNames[i] = ConnectivityManager.getNetworkTypeName(netType); i++; } } return upstreamNames; } /** Check whether dun is required. */ public static boolean checkDunRequired(Context ctx) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); Loading Loading @@ -388,6 +372,15 @@ public class TetheringConfiguration { return false; } private static int[] toIntArray(Collection<Integer> values) { final int[] result = new int[values.size()]; int index = 0; for (Integer value : values) { result[index++] = value; } return result; } /** * Convert this TetheringConfiguration to a TetheringConfigurationParcel. */ Loading @@ -400,12 +393,7 @@ public class TetheringConfiguration { parcel.isDunRequired = isDunRequired; parcel.chooseUpstreamAutomatically = chooseUpstreamAutomatically; int[] preferredTypes = new int[preferredUpstreamIfaceTypes.size()]; int index = 0; for (Integer type : preferredUpstreamIfaceTypes) { preferredTypes[index++] = type; } parcel.preferredUpstreamIfaceTypes = preferredTypes; parcel.preferredUpstreamIfaceTypes = toIntArray(preferredUpstreamIfaceTypes); parcel.legacyDhcpRanges = legacyDhcpRanges; parcel.defaultIPv4DNS = defaultIPv4DNS; Loading Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -619,6 +619,7 @@ filegroup { "core/java/com/android/internal/util/Preconditions.java", "core/java/com/android/internal/util/State.java", "core/java/com/android/internal/util/StateMachine.java", "core/java/com/android/internal/util/TrafficStatsConstants.java", "core/java/android/net/shared/Inet4AddressUtils.java", ], } Loading
packages/Tethering/jarjar-rules.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ rule com.android.internal.util.MessageUtils* com.android.networkstack.tethering. rule com.android.internal.util.Preconditions* com.android.networkstack.tethering.util.Preconditions@1 rule com.android.internal.util.State* com.android.networkstack.tethering.util.State@1 rule com.android.internal.util.StateMachine* com.android.networkstack.tethering.util.StateMachine@1 rule com.android.internal.util.TrafficStatsConstants* com.android.networkstack.tethering.util.TrafficStatsConstants@1 rule android.net.LocalLog* com.android.networkstack.tethering.LocalLog@1 Loading
packages/Tethering/src/android/net/ip/RouterAdvertisementDaemon.java +1 −1 Original line number Diff line number Diff line Loading @@ -668,7 +668,7 @@ public class RouterAdvertisementDaemon { } private final class UnicastResponder extends Thread { private final InetSocketAddress mSolicitor = new InetSocketAddress(); private final InetSocketAddress mSolicitor = new InetSocketAddress(0); // The recycled buffer for receiving Router Solicitations from clients. // If the RS is larger than IPV6_MIN_MTU the packets are truncated. // This is fine since currently only byte 0 is examined anyway. Loading
packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java +8 −11 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ import android.net.LinkAddress; import android.net.LinkProperties; import android.net.Network; import android.net.NetworkInfo; import android.net.NetworkUtils; import android.net.TetherStatesParcel; import android.net.TetheringConfigurationParcel; import android.net.ip.IpServer; Loading Loading @@ -291,13 +290,6 @@ public class Tethering { filter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); filter.addAction(UserManager.ACTION_USER_RESTRICTIONS_CHANGED); mContext.registerReceiver(mStateReceiver, filter, null, handler); filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SHARED); filter.addAction(Intent.ACTION_MEDIA_UNSHARED); filter.addDataScheme("file"); mContext.registerReceiver(mStateReceiver, filter, null, handler); } private class TetheringThreadExecutor implements Executor { Loading Loading @@ -1384,12 +1376,17 @@ public class Tethering { protected void setDnsForwarders(final Network network, final LinkProperties lp) { // TODO: Set v4 and/or v6 DNS per available connectivity. String[] dnsServers = mConfig.defaultIPv4DNS; final Collection<InetAddress> dnses = lp.getDnsServers(); // TODO: Properly support the absence of DNS servers. final String[] dnsServers; if (dnses != null && !dnses.isEmpty()) { // TODO: remove this invocation of NetworkUtils.makeStrings(). dnsServers = NetworkUtils.makeStrings(dnses); dnsServers = new String[dnses.size()]; int i = 0; for (InetAddress dns : dnses) { dnsServers[i++] = dns.getHostAddress(); } } else { dnsServers = mConfig.defaultIPv4DNS; } final int netId = (network != null) ? network.netId : NETID_UNSET; try { Loading
packages/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java +13 −25 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import static com.android.internal.R.string.config_mobile_hotspot_provision_app_ import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.TetheringConfigurationParcel; import android.net.util.SharedLog; import android.provider.Settings; Loading Loading @@ -179,8 +178,8 @@ public class TetheringConfiguration { pw.print("chooseUpstreamAutomatically: "); pw.println(chooseUpstreamAutomatically); dumpStringArray(pw, "preferredUpstreamIfaceTypes", preferredUpstreamNames(preferredUpstreamIfaceTypes)); pw.print("legacyPreredUpstreamIfaceTypes: "); pw.println(Arrays.toString(toIntArray(preferredUpstreamIfaceTypes))); dumpStringArray(pw, "legacyDhcpRanges", legacyDhcpRanges); dumpStringArray(pw, "defaultIPv4DNS", defaultIPv4DNS); Loading @@ -205,7 +204,7 @@ public class TetheringConfiguration { sj.add(String.format("isDunRequired:%s", isDunRequired)); sj.add(String.format("chooseUpstreamAutomatically:%s", chooseUpstreamAutomatically)); sj.add(String.format("preferredUpstreamIfaceTypes:%s", makeString(preferredUpstreamNames(preferredUpstreamIfaceTypes)))); toIntArray(preferredUpstreamIfaceTypes))); sj.add(String.format("provisioningApp:%s", makeString(provisioningApp))); sj.add(String.format("provisioningAppNoUi:%s", provisioningAppNoUi)); sj.add(String.format("enableLegacyDhcpServer:%s", enableLegacyDhcpServer)); Loading Loading @@ -234,21 +233,6 @@ public class TetheringConfiguration { return sj.toString(); } private static String[] preferredUpstreamNames(Collection<Integer> upstreamTypes) { String[] upstreamNames = null; if (upstreamTypes != null) { upstreamNames = new String[upstreamTypes.size()]; int i = 0; for (Integer netType : upstreamTypes) { upstreamNames[i] = ConnectivityManager.getNetworkTypeName(netType); i++; } } return upstreamNames; } /** Check whether dun is required. */ public static boolean checkDunRequired(Context ctx) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); Loading Loading @@ -388,6 +372,15 @@ public class TetheringConfiguration { return false; } private static int[] toIntArray(Collection<Integer> values) { final int[] result = new int[values.size()]; int index = 0; for (Integer value : values) { result[index++] = value; } return result; } /** * Convert this TetheringConfiguration to a TetheringConfigurationParcel. */ Loading @@ -400,12 +393,7 @@ public class TetheringConfiguration { parcel.isDunRequired = isDunRequired; parcel.chooseUpstreamAutomatically = chooseUpstreamAutomatically; int[] preferredTypes = new int[preferredUpstreamIfaceTypes.size()]; int index = 0; for (Integer type : preferredUpstreamIfaceTypes) { preferredTypes[index++] = type; } parcel.preferredUpstreamIfaceTypes = preferredTypes; parcel.preferredUpstreamIfaceTypes = toIntArray(preferredUpstreamIfaceTypes); parcel.legacyDhcpRanges = legacyDhcpRanges; parcel.defaultIPv4DNS = defaultIPv4DNS; Loading