import android.net.NetworkUtils;
import android.net.RouteInfo;
import android.os.Binder;
-import android.os.HandlerThread;
-import android.os.IBinder;
import android.os.INetworkManagementService;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
-import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import com.android.internal.util.IState;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
+import com.android.server.IoThread;
import com.google.android.collect.Lists;
import java.io.FileDescriptor;
private final INetworkStatsService mStatsService;
private final IConnectivityManager mConnService;
private Looper mLooper;
- private HandlerThread mThread;
private HashMap<String, TetherInterfaceSM> mIfaces; // all tethered/tetherable ifaces
mIfaces = new HashMap<String, TetherInterfaceSM>();
// make our own thread so we don't anr the system
- mThread = new HandlerThread("Tethering");
- mThread.start();
- mLooper = mThread.getLooper();
+ mLooper = IoThread.get().getLooper();
mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper);
mTetherMasterSM.start();
// ignore usb0 down after enabling RNDIS
// we will handle disconnect in interfaceRemoved instead
if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
+ } else if (isBluetooth(iface)) {
+ // ignore interface down for bt liskstate change
+ // disconnect will only be handled in interfaceRemoved
+ if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
} else if (sm != null) {
sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
mIfaces.remove(iface);
}
}
+ public void addressUpdated(String address, String iface, int flags, int scope) {}
+
+ public void addressRemoved(String address, String iface, int flags, int scope) {}
+
public void limitReached(String limitName, String iface) {}
public void interfaceClassDataActivityChanged(String label, boolean active) {}
return retVal;
}
- public String[] getTetheredIfacePairs() {
- final ArrayList<String> list = Lists.newArrayList();
- synchronized (mPublicSync) {
- for (TetherInterfaceSM sm : mIfaces.values()) {
- if (sm.isTethered()) {
- list.add(sm.mMyUpstreamIfaceName);
- list.add(sm.mIfaceName);
- }
- }
- }
- return list.toArray(new String[list.size()]);
- }
-
public String[] getTetherableIfaces() {
ArrayList<String> list = new ArrayList<String>();
synchronized (mPublicSync) {