From ca73c0c00bda1fc592bab9dd54c90fd59c46bfd2 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 28 Jul 2017 11:33:08 -0700 Subject: WifiStateMachine: Pass in looper to PhoneStateListener Pass in wifi state machine's looper to the PhoneStateListener created. This should also fix the unit test failures reported. Bug: 64143471 Test: Unit tests pass (Will need to verify that it also fixed the automated test failures since I'm unable to reproduce it locally). Change-Id: I1aae7535dc23460a666d263d8042a72d63e16c27 --- service/java/com/android/server/wifi/WifiStateMachine.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index e4abc96bb..b2a649cea 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -947,7 +947,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss mFacade.makeSupplicantStateTracker(context, mWifiConfigManager, getHandler()); mLinkProperties = new LinkProperties(); - mPhoneStateListener = new WifiPhoneStateListener(); + mPhoneStateListener = new WifiPhoneStateListener(looper); mNetworkInfo.setIsAvailable(false); mLastBssid = null; @@ -3772,6 +3772,10 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss * Listen for phone call state events to set/reset TX power limits for SAR requirements. */ private class WifiPhoneStateListener extends PhoneStateListener { + WifiPhoneStateListener(Looper looper) { + super(looper); + } + @Override public void onCallStateChanged(int state, String incomingNumber) { if (mEnableVoiceCallSarTxPowerLimit) { -- cgit v1.2.3