Loading services/core/java/com/android/server/connectivity/Tethering.java +9 −1 Original line number Diff line number Diff line Loading @@ -252,6 +252,12 @@ public class Tethering extends BaseNetworkObserver { mUpstreamNetworkMonitor.updateMobileRequiresDun(mConfig.isDunRequired); } private void maybeUpdateConfiguration() { final int dunCheck = TetheringConfiguration.checkDunRequired(mContext); if (dunCheck == mConfig.dunCheck) return; updateConfiguration(); } @Override public void interfaceStatusChanged(String iface, boolean up) { // Never called directly: only called from interfaceLinkStateChanged. Loading Loading @@ -1273,7 +1279,9 @@ public class Tethering extends BaseNetworkObserver { } protected void chooseUpstreamType(boolean tryCell) { updateConfiguration(); // TODO - remove? // We rebuild configuration on ACTION_CONFIGURATION_CHANGED, but we // do not currently know how to watch for changes in DUN settings. maybeUpdateConfiguration(); final NetworkState ns = mUpstreamNetworkMonitor.selectPreferredUpstreamType( mConfig.preferredUpstreamIfaceTypes); Loading services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java +3 −2 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class TetheringConfiguration { public final String[] tetherableUsbRegexs; public final String[] tetherableWifiRegexs; public final String[] tetherableBluetoothRegexs; public final int dunCheck; public final boolean isDunRequired; public final Collection<Integer> preferredUpstreamIfaceTypes; public final String[] dhcpRanges; Loading @@ -85,7 +86,7 @@ public class TetheringConfiguration { tetherableBluetoothRegexs = ctx.getResources().getStringArray( com.android.internal.R.array.config_tether_bluetooth_regexs); final int dunCheck = checkDunRequired(ctx); dunCheck = checkDunRequired(ctx); configLog.log("DUN check returned: " + dunCheckString(dunCheck)); preferredUpstreamIfaceTypes = getUpstreamIfaceTypes(ctx, dunCheck); Loading Loading @@ -172,7 +173,7 @@ public class TetheringConfiguration { return upstreamNames; } private static int checkDunRequired(Context ctx) { public static int checkDunRequired(Context ctx) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); return (tm != null) ? tm.getTetherApnRequired() : DUN_UNSPECIFIED; } Loading Loading
services/core/java/com/android/server/connectivity/Tethering.java +9 −1 Original line number Diff line number Diff line Loading @@ -252,6 +252,12 @@ public class Tethering extends BaseNetworkObserver { mUpstreamNetworkMonitor.updateMobileRequiresDun(mConfig.isDunRequired); } private void maybeUpdateConfiguration() { final int dunCheck = TetheringConfiguration.checkDunRequired(mContext); if (dunCheck == mConfig.dunCheck) return; updateConfiguration(); } @Override public void interfaceStatusChanged(String iface, boolean up) { // Never called directly: only called from interfaceLinkStateChanged. Loading Loading @@ -1273,7 +1279,9 @@ public class Tethering extends BaseNetworkObserver { } protected void chooseUpstreamType(boolean tryCell) { updateConfiguration(); // TODO - remove? // We rebuild configuration on ACTION_CONFIGURATION_CHANGED, but we // do not currently know how to watch for changes in DUN settings. maybeUpdateConfiguration(); final NetworkState ns = mUpstreamNetworkMonitor.selectPreferredUpstreamType( mConfig.preferredUpstreamIfaceTypes); Loading
services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java +3 −2 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class TetheringConfiguration { public final String[] tetherableUsbRegexs; public final String[] tetherableWifiRegexs; public final String[] tetherableBluetoothRegexs; public final int dunCheck; public final boolean isDunRequired; public final Collection<Integer> preferredUpstreamIfaceTypes; public final String[] dhcpRanges; Loading @@ -85,7 +86,7 @@ public class TetheringConfiguration { tetherableBluetoothRegexs = ctx.getResources().getStringArray( com.android.internal.R.array.config_tether_bluetooth_regexs); final int dunCheck = checkDunRequired(ctx); dunCheck = checkDunRequired(ctx); configLog.log("DUN check returned: " + dunCheckString(dunCheck)); preferredUpstreamIfaceTypes = getUpstreamIfaceTypes(ctx, dunCheck); Loading Loading @@ -172,7 +173,7 @@ public class TetheringConfiguration { return upstreamNames; } private static int checkDunRequired(Context ctx) { public static int checkDunRequired(Context ctx) { final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); return (tm != null) ? tm.getTetherApnRequired() : DUN_UNSPECIFIED; } Loading