From 008ff39b7cb1a1f80f29595459fd82a55ce52b83 Mon Sep 17 00:00:00 2001 From: Chia-chi Yeh Date: Mon, 23 May 2011 15:08:29 -0700 Subject: Do not register the callbacks in the constructor. Change-Id: Ic7509c35cfb17b022a2af3cc14170942d6510e2d --- services/java/com/android/server/ConnectivityService.java | 6 ++++++ services/java/com/android/server/connectivity/Tethering.java | 7 ------- 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 d2fd04bf0fe4..9158d9e1f4fa 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 e8155b480444..fcf23564f169 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(); // make our own thread so we don't anr the system -- cgit v1.2.3-59-g8ed1b