summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-04-06 00:14:11 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-06 00:14:11 +0000
commitf48695bc11357bc31fe313efb033ef0902360625 (patch)
tree4a93b44f8ee642adcf3ec5446a6768fe746b8e01
parent48fe3bb3b0458b66cba87a753cdba1ac0b8c4df3 (diff)
parent6acf1cd8e4227ec9c58f8786fee4682cf46da845 (diff)
Merge "WifiServiceImpl: fix failing test" am: c258cac284 am: 87bbb7718a
am: 6acf1cd8e4 Change-Id: I69ea4d3416af1508d97386fd63213858a5e1792d
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index a327fa7b1..c3e80705d 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1481,8 +1481,7 @@ public class WifiServiceImpl extends IWifiManager.Stub {
mWifiController.sendMessage(CMD_SCAN_ALWAYS_MODE_CHANGED);
}
};
-
- mContext.getContentResolver().registerContentObserver(
+ mFrameworkFacade.registerContentObserver(mContext,
Settings.Global.getUriFor(Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE),
false, contentObserver);
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index 71ca0204f..4cdd0f684 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -151,10 +151,13 @@ public class WifiServiceImplTest {
when(mWifiInjector.getWifiController()).thenReturn(mWifiController);
when(mWifiInjector.getWifiMetrics()).thenReturn(mWifiMetrics);
when(mWifiInjector.getWifiStateMachine()).thenReturn(mWifiStateMachine);
+ when(mWifiStateMachine.syncInitialize(any())).thenReturn(true);
when(mWifiInjector.getWifiServiceHandlerThread()).thenReturn(mHandlerThread);
when(mHandlerThread.getLooper()).thenReturn(mLooper.getLooper());
when(mContext.getResources()).thenReturn(mResources);
when(mContext.getContentResolver()).thenReturn(mContentResolver);
+ doNothing().when(mFrameworkFacade).registerContentObserver(eq(mContext), any(),
+ anyBoolean(), any());
IPowerManager powerManagerService = mock(IPowerManager.class);
mPowerManager = new PowerManager(mContext, powerManagerService, new Handler());
when(mContext.getSystemServiceName(PowerManager.class)).thenReturn(Context.POWER_SERVICE);