commit | 7c11e2cfa889a4863c28feebd90b418ac384ffa5 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Mon Dec 17 21:28:26 2018 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon Dec 17 21:28:26 2018 +0000 |
tree | 49bbe11adf5ce64aebe67886d1f160b8c029d790 | |
parent | feb504cb6626aab7b957ddee1c13f9cbadd7314c [diff] | |
parent | 54d44962bef76d567ad597a26eff0f0de7e4de6b [diff] |
Merge "Fix a race condition in DeviceIdleControllerTest."
diff --git a/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java b/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java index 04a8408..cff0521 100644 --- a/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java +++ b/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java
@@ -203,6 +203,8 @@ .strictness(Strictness.LENIENT) .mockStatic(LocalServices.class) .startMocking(); + spyOn(getContext()); + doReturn(null).when(getContext()).registerReceiver(any(), any()); doReturn(mock(ActivityManagerInternal.class)) .when(() -> LocalServices.getService(ActivityManagerInternal.class)); doReturn(mock(ActivityTaskManagerInternal.class))