From 7e91548e461e52af8e78ba2e968395caf29b55bf Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 1 Aug 2017 16:40:56 -0700 Subject: RELAND: HalDeviceManager: Get IWifi proxy immediately Try to get IWifi proxy as a part of HalDeviceManager.initialize() directly instead of waiting for the IServiceMAnager callback. When HalDeviceManager.initialize() is invoked: a) If the wifi service is up at that point, we will get the proxy immediately and IServiceManager callback will be ignored. b) If the wifi service is not up at that point, we will get the proxy as a part of the IServiceManager callback. Bug: 64226605 Test: Unit tests Test: Regression test request. Change-Id: I3d6b89edb3f446bb39984d1ebb3caeb53011bec9 --- service/java/com/android/server/wifi/HalDeviceManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/HalDeviceManager.java b/service/java/com/android/server/wifi/HalDeviceManager.java index 4382c8126..d6009c709 100644 --- a/service/java/com/android/server/wifi/HalDeviceManager.java +++ b/service/java/com/android/server/wifi/HalDeviceManager.java @@ -532,6 +532,9 @@ public class HalDeviceManager { private void initializeInternal() { initIServiceManagerIfNecessary(); + if (isSupportedInternal()) { + initIWifiIfNecessary(); + } } private void teardownInternal() { @@ -561,9 +564,7 @@ public class HalDeviceManager { Log.d(TAG, "IWifi registration notification: fqName=" + fqName + ", name=" + name + ", preexisting=" + preexisting); synchronized (mLock) { - mWifi = null; // get rid of old copy! initIWifiIfNecessary(); - stopWifi(); // just in case } } }; @@ -673,7 +674,8 @@ public class HalDeviceManager { mWifi = null; return; } - managerStatusListenerDispatch(); + // Stopping wifi just in case. This would also trigger the status callback. + stopWifi(); } catch (RemoteException e) { Log.e(TAG, "Exception while operating on IWifi: " + e); } -- cgit v1.2.3