diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java index 1afbfb0ab1..7d30056be1 100644 --- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java +++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java @@ -106,6 +106,8 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { private static final String KEY_NETWORK_STATE_OBSERVER = TEST_PKG + ".observer"; + private static final String EMPTY_STRING = ""; + protected static final int TYPE_COMPONENT_ACTIVTIY = 0; protected static final int TYPE_COMPONENT_FOREGROUND_SERVICE = 1; @@ -206,6 +208,8 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { final String resultData = getResultData(); if (resultData == null) { Log.e(TAG, "Received null data from ordered intent"); + // Offer an empty string so that the code waiting for the result can return. + result.offer(EMPTY_STRING); return; } result.offer(resultData);