Fix tethering upstream determination.
Used to use iface names, but on mobile ifaces are multipurpose. Refined to use ConnectivityService types. bug:4530116 Change-Id: Iaa632d5f540d27ffff683bd7d94f8004bf422e71
This commit is contained in:
@@ -163,6 +163,12 @@ public class ConnectivityManager
|
||||
*/
|
||||
public static final String EXTRA_ERRORED_TETHER = "erroredArray";
|
||||
|
||||
/**
|
||||
* The absence of APN..
|
||||
* @hide
|
||||
*/
|
||||
public static final int TYPE_NONE = -1;
|
||||
|
||||
/**
|
||||
* The Default Mobile data connection. When active, all data traffic
|
||||
* will use this connection by default.
|
||||
|
||||
@@ -431,12 +431,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
|
||||
mTethering = new Tethering(mContext, mHandler.getLooper());
|
||||
mTetheringConfigValid = (((mNetTrackers[ConnectivityManager.TYPE_MOBILE_DUN] != null) ||
|
||||
!mTethering.isDunRequired()) &&
|
||||
(mTethering.getTetherableUsbRegexs().length != 0 ||
|
||||
mTetheringConfigValid = ((mTethering.getTetherableUsbRegexs().length != 0 ||
|
||||
mTethering.getTetherableWifiRegexs().length != 0 ||
|
||||
mTethering.getTetherableBluetoothRegexs().length != 0) &&
|
||||
mTethering.getUpstreamIfaceRegexs().length != 0);
|
||||
mTethering.getUpstreamIfaceTypes().length != 0);
|
||||
|
||||
if (DBG) {
|
||||
mInetLog = new ArrayList();
|
||||
@@ -1400,12 +1398,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
} else {
|
||||
addPrivateDnsRoutes(mNetTrackers[netType]);
|
||||
}
|
||||
|
||||
/** Notify TetheringService if interface name has been changed. */
|
||||
if (TextUtils.equals(mNetTrackers[netType].getNetworkInfo().getReason(),
|
||||
Phone.REASON_LINK_PROPERTIES_CHANGED)) {
|
||||
handleTetherIfaceChange(netType);
|
||||
}
|
||||
} else {
|
||||
if (mNetConfigs[netType].isDefault()) {
|
||||
removeDefaultRoute(mNetTrackers[netType]);
|
||||
@@ -2253,14 +2245,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTetherIfaceChange(int type) {
|
||||
String iface = mNetTrackers[type].getLinkProperties().getInterfaceName();
|
||||
|
||||
if (isTetheringSupported()) {
|
||||
mTethering.handleTetherIfaceChange(iface);
|
||||
}
|
||||
}
|
||||
|
||||
private void log(String s) {
|
||||
Slog.d(TAG, s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user