am be348964: Merge "Move Tethering off the ServerThread." into froyo
Merge commit 'be34896457bb37b4e263efa87316d2e2420adab3' into froyo-plus-aosp
* commit 'be34896457bb37b4e263efa87316d2e2420adab3':
Move Tethering off the ServerThread.
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index f335287..b43b86c 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -35,6 +35,7 @@
import android.os.BatteryManager;
import android.os.Binder;
import android.os.Environment;
+import android.os.HandlerThread;
import android.os.IBinder;
import android.os.INetworkManagementService;
import android.os.Looper;
@@ -75,7 +76,8 @@
private String[] mTetherableWifiRegexs;
private String[] mUpstreamIfaceRegexs;
- private Looper mLooper; // given to us at construction time..
+ private Looper mLooper;
+ private HandlerThread mThread;
private HashMap<String, TetherInterfaceSM> mIfaces; // all tethered/tetherable ifaces
@@ -123,6 +125,10 @@
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();
mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper);
mTetherMasterSM.start();