Add build options for tethering.
Dun-required bool and list of allowed upstream ifaces.
This commit is contained in:
@@ -66,6 +66,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
|
|
||||||
|
|
||||||
private Tethering mTethering;
|
private Tethering mTethering;
|
||||||
|
private boolean mTetheringConfigValid = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sometimes we want to refer to the individual network state
|
* Sometimes we want to refer to the individual network state
|
||||||
@@ -320,6 +321,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTethering = new Tethering(mContext);
|
mTethering = new Tethering(mContext);
|
||||||
|
mTetheringConfigValid = (((mNetTrackers[ConnectivityManager.TYPE_MOBILE_DUN] != null) ||
|
||||||
|
!mTethering.isDunRequired()) &&
|
||||||
|
(mTethering.getTetherableUsbRegexs().length != 0 ||
|
||||||
|
mTethering.getTetherableWifiRegexs().length != 0) &&
|
||||||
|
mTethering.getUpstreamIfaceRegexs().length != 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1498,8 +1505,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
public boolean isTetheringSupported() {
|
public boolean isTetheringSupported() {
|
||||||
enforceTetherAccessPermission();
|
enforceTetherAccessPermission();
|
||||||
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
|
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
|
||||||
return ((Settings.Secure.getInt(mContext.getContentResolver(),
|
boolean tetherEnabledInSettings = (Settings.Secure.getInt(mContext.getContentResolver(),
|
||||||
Settings.Secure.TETHER_SUPPORTED, defaultVal) != 0) &&
|
Settings.Secure.TETHER_SUPPORTED, defaultVal) != 0);
|
||||||
(mNetTrackers[ConnectivityManager.TYPE_MOBILE_DUN] != null));
|
return tetherEnabledInSettings && mTetheringConfigValid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user