[CM] Fix NPE due to unvalidated callback value

Fix flaky test resulting from the above fix.

Bug: 132950880
Fix: 133457081
Test: atest ConnectivityServiceTest
Merged-In: Ia2cc04b42288ea987483e5ab0e0a10093dc49502
Change-Id: Ia2cc04b42288ea987483e5ab0e0a10093dc49502
(cherry picked from commit c8289e40a4)
This commit is contained in:
Etan Cohen
2019-05-23 09:16:26 -07:00
committed by Lorenzo Colitti
parent d905f7f74a
commit 7a66717d89

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);