summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-04-06 00:08:10 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-06 00:08:10 +0000
commit87bbb7718a8d6a2d5cd419064825528ad2e861f6 (patch)
tree34526c86c792c9e7474f7c6a3edfbd040b169403
parent34a0ef0ab2cdcd9d767069b841137794056386ee (diff)
parentc258cac284560bef4d8be2abae9ff50015d5f9d0 (diff)
Merge "WifiServiceImpl: fix failing test"
am: c258cac284 Change-Id: I72069d71f41eee1892f79a5db85e11f3427047b4
-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 03a88bc4e..f915a6d4f 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1477,8 +1477,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 e5289ac32..5684ce6de 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -149,10 +149,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);