resolved conflicts for merge of f9774dc7 to master
Change-Id: Ia9509ab6897e27da8bf4fc61a4140f2f93acb80f
This commit is contained in:
@@ -179,7 +179,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
private static final int MAX_HOSTROUTE_CYCLE_COUNT = 10;
|
||||
|
||||
private Tethering mTethering;
|
||||
private boolean mTetheringConfigValid = false;
|
||||
|
||||
private KeyStore mKeyStore;
|
||||
|
||||
@@ -595,12 +594,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
|
||||
mTethering = new Tethering(mContext, mNetd, statsService, this, mHandler.getLooper());
|
||||
mTetheringConfigValid = ((mTethering.getTetherableUsbRegexs().length != 0 ||
|
||||
mTethering.getTetherableWifiRegexs().length != 0 ||
|
||||
mTethering.getTetherableBluetoothRegexs().length != 0) &&
|
||||
mTethering.getUpstreamIfaceTypes().length != 0);
|
||||
//set up the listener for user state for creating user VPNs
|
||||
|
||||
//set up the listener for user state for creating user VPNs
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction(Intent.ACTION_USER_STARTING);
|
||||
intentFilter.addAction(Intent.ACTION_USER_STOPPING);
|
||||
@@ -3027,7 +3022,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
|
||||
boolean tetherEnabledInSettings = (Settings.Global.getInt(mContext.getContentResolver(),
|
||||
Settings.Global.TETHER_SUPPORTED, defaultVal) != 0);
|
||||
return tetherEnabledInSettings && mTetheringConfigValid;
|
||||
return tetherEnabledInSettings && ((mTethering.getTetherableUsbRegexs().length != 0 ||
|
||||
mTethering.getTetherableWifiRegexs().length != 0 ||
|
||||
mTethering.getTetherableBluetoothRegexs().length != 0) &&
|
||||
mTethering.getUpstreamIfaceTypes().length != 0);
|
||||
}
|
||||
|
||||
// An API NetworkStateTrackers can call when they lose their network.
|
||||
|
||||
@@ -152,6 +152,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(UsbManager.ACTION_USB_STATE);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
|
||||
mContext.registerReceiver(mStateReceiver, filter);
|
||||
|
||||
filter = new IntentFilter();
|
||||
@@ -511,6 +512,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
|
||||
if (VDBG) Log.d(TAG, "Tethering got CONNECTIVITY_ACTION");
|
||||
mTetherMasterSM.sendMessage(TetherMasterSM.CMD_UPSTREAM_CHANGED);
|
||||
}
|
||||
} else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
|
||||
updateConfiguration();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -613,7 +616,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
|
||||
public int[] getUpstreamIfaceTypes() {
|
||||
int values[];
|
||||
synchronized (mPublicSync) {
|
||||
updateConfiguration();
|
||||
updateConfiguration(); // TODO - remove?
|
||||
values = new int[mUpstreamIfaceTypes.size()];
|
||||
Iterator<Integer> iterator = mUpstreamIfaceTypes.iterator();
|
||||
for (int i=0; i < mUpstreamIfaceTypes.size(); i++) {
|
||||
@@ -1284,7 +1287,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
|
||||
int upType = ConnectivityManager.TYPE_NONE;
|
||||
String iface = null;
|
||||
|
||||
updateConfiguration();
|
||||
updateConfiguration(); // TODO - remove?
|
||||
|
||||
synchronized (mPublicSync) {
|
||||
if (VDBG) {
|
||||
|
||||
Reference in New Issue
Block a user