Merge "Fix some comments around stopTetheringRequest" into main

This commit is contained in:
Treehugger Robot 2025-01-31 01:59:17 -08:00 • committed by Gerrit Code Review
commit f09acc7281
2 changed files with 5 additions and 2 deletions

View file

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

View file

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