summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-05-23 15:08:29 -0700
committerChia-chi Yeh <chiachi@android.com>2011-05-23 15:08:29 -0700
commit008ff39b7cb1a1f80f29595459fd82a55ce52b83 (patch)
tree3085992ecc73448ac338dcb5f5b3d34cad8c06af
parent560e97f8e0cb63a0fa6e88db6badc142a99517d2 (diff)
downloadframeworks_base-008ff39b7cb1a1f80f29595459fd82a55ce52b83.zip
frameworks_base-008ff39b7cb1a1f80f29595459fd82a55ce52b83.tar.gz
frameworks_base-008ff39b7cb1a1f80f29595459fd82a55ce52b83.tar.bz2
Do not register the callbacks in the constructor.
Change-Id: Ic7509c35cfb17b022a2af3cc14170942d6510e2d
-rw-r--r--services/java/com/android/server/ConnectivityService.java6
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java7
2 files changed, 6 insertions, 7 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index d2fd04b..9158d9e 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -441,6 +441,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mTethering.getTetherableBluetoothRegexs().length != 0) &&
mTethering.getUpstreamIfaceRegexs().length != 0);
+ try {
+ nmService.registerObserver(mTethering);
+ } catch (RemoteException e) {
+ loge("Error registering observer :" + e);
+ }
+
if (DBG) {
mInetLog = new ArrayList();
}
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index e8155b4..fcf2356 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -129,13 +129,6 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
mNMService = nmService;
mLooper = looper;
- // register for notifications from NetworkManagement Service
- try {
- mNMService.registerObserver(this);
- } catch (RemoteException e) {
- Log.e(TAG, "Error registering observer :" + e);
- }
-
mIfaces = new HashMap<String, TetherInterfaceSM>();
// make our own thread so we don't anr the system