Never create native network immediately.

This patch flags off the functionality added by aosp/2162425
in the wake of b/286649301 where a race in ConnectivityService
breaks WiFi connectivity until reboot.

Bug: 286649301
Test: NetworkAgentTest
      ConnectivityServiceTest
Change-Id: I96d755445f6e1f88bb71a7d32742e87dae185250
This commit is contained in:
Chalard Jean
2023-06-27 19:16:00 +09:00
parent 3160bc0825
commit a16607f421
2 changed files with 18 additions and 10 deletions

View File

@@ -4548,9 +4548,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
@VisibleForTesting
protected static boolean shouldCreateNetworksImmediately() {
// Before U, physical networks are only created when the agent advances to CONNECTED.
// In U and above, all networks are immediately created when the agent is registered.
return SdkLevel.isAtLeastU();
// The feature of creating the networks immediately was slated for U, but race conditions
// detected late required this was flagged off.
// TODO : enable this in a Mainline update or in V, and re-enable the test for this
// in NetworkAgentTest.
return false;
}
private static boolean shouldCreateNativeNetwork(@NonNull NetworkAgentInfo nai,