[CM] Fix NPE due to unvalidated callback value

Fix flaky test resulting from the above fix.

Bug: 132950880
Test: atest ConnectivityServiceTest
Change-Id: I1ddf3bb016239bf88cdd8843a71dcb5e582e83ac
This commit is contained in:
Etan Cohen
2019-05-23 08:16:20 -07:00
parent 26c1cdb19d
commit 1f1bcb0b68

View File

@@ -3864,6 +3864,7 @@ public class ConnectivityServiceTest {
}
}
testFactory.expectRemoveRequests(1);
if (preUnregister) {
mCm.unregisterNetworkCallback(networkCallback);
@@ -3873,7 +3874,6 @@ public class ConnectivityServiceTest {
testFactory.triggerUnfulfillable(requests.get(newRequestId));
} else {
// Simulate the factory releasing the request as unfulfillable and expect onUnavailable!
testFactory.expectRemoveRequests(1);
testFactory.triggerUnfulfillable(requests.get(newRequestId));
networkCallback.expectCallback(CallbackState.UNAVAILABLE, null);