Fix some comments around stopTetheringRequest
Bug: 216524590
Test: atest TetheringManagerTest
Change-Id: Iae0baa8ad7c199770666e2f78813cf0224ea1a9b
diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java
index 60263ac..8994ea8 100644
--- a/Tethering/src/com/android/networkstack/tethering/Tethering.java
+++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java
@@ -734,6 +734,9 @@
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 7ce99eb..9e49926 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 @@
// 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();