diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java index c2a7622f28..1249e85b19 100644 --- a/Tethering/src/com/android/networkstack/tethering/Tethering.java +++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java @@ -736,6 +736,9 @@ public class Tethering { if (mPendingTetheringRequests.valueAt(i).getTetheringType() == type) return true; } for (TetherState state : mTetherStates.values()) { + // TODO: isCurrentlyServing only starts returning true once the IpServer has processed + // the CMD_TETHER_REQUESTED. Ensure that we consider the request to be serving even when + // that has not happened yet. if (state.isCurrentlyServing() && state.ipServer.interfaceType() == type) return true; } return false; diff --git a/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java b/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java index 7ce99eb8e5..9e49926fca 100644 --- a/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java +++ b/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java @@ -465,13 +465,13 @@ public class TetheringManagerTest { // stopTethering without any tethering active should fail. TetheringRequest request = new TetheringRequest.Builder(TETHERING_WIFI).build(); - mCtsTetheringUtils.stopTethering(request, false /* succeeded */); + mCtsTetheringUtils.stopTethering(request, false /* expectSuccess */); // Start wifi tethering mCtsTetheringUtils.startWifiTethering(tetherEventCallback); // stopTethering should succeed now that there's a request. - mCtsTetheringUtils.stopTethering(request, true /* succeeded */); + mCtsTetheringUtils.stopTethering(request, true /* expectSuccess */); tetherEventCallback.expectNoTetheringActive(); } finally { mCtsTetheringUtils.stopAllTethering();