Merge "Prevent hotspot from being affected by the wifi retention feature" am: ac7a0e3ee9 am: f9a4202c81 am: 7250ed0ec3 am: 5963d8147f am: 994a74d78a

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2550151

Change-Id: I4e6f1293e12f52bd168befc1e9f1a6ba01195887
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-05-08 10:46:21 +00:00 • committed by Automerger Merge Worker
commit c5e346da48

View file

@ -2573,6 +2573,14 @@ public class ConnectivityManagerTest {
tetherUtils.registerTetheringEventCallback();
try {
tetherEventCallback.assumeWifiTetheringSupported(mContext);
// To prevent WiFi-to-WiFi interruption while entering APM:
// - If WiFi is retained while entering APM, hotspot will also remain enabled.
// - If WiFi is off before APM or disabled while entering APM, hotspot will be
// disabled.
//
// To ensure hotspot always be disabled after enabling APM, disable wifi before
// enabling the hotspot.
mCtsNetUtils.disableWifi();
tetherUtils.startWifiTethering(tetherEventCallback);
// Update setting to verify the behavior.
@ -2606,6 +2614,7 @@ public class ConnectivityManagerTest {
ConnectivitySettingsManager.setPrivateDnsMode(mContext, curPrivateDnsMode);
tetherUtils.unregisterTetheringEventCallback(tetherEventCallback);
tetherUtils.stopAllTethering();
mCtsNetUtils.ensureWifiConnected();
}
}