Fix a bug where adding a user doesn't update network allow lists
Even if there are no preferences, the allow list needs
to be updated upon adding a new user, because it's set
unconditionally when the network connects.
Adding all existing UIDs would address this issue too
and we probably want to do it, but immediately this
seems simpler.
Bug: 266136779
Test: new test for this
Change-Id: I77091a6c3d3ccf2b80ab0aaa01d09ef0df922501
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java
index b9d2760..f5c6fb7 100755
--- a/service/src/com/android/server/ConnectivityService.java
+++ b/service/src/com/android/server/ConnectivityService.java
@@ -6245,9 +6245,7 @@
if (mOemNetworkPreferences.getNetworkPreferences().size() > 0) {
handleSetOemNetworkPreference(mOemNetworkPreferences, null);
}
- if (!mProfileNetworkPreferences.isEmpty()) {
- updateProfileAllowedNetworks();
- }
+ updateProfileAllowedNetworks();
}
private void onUserRemoved(@NonNull final UserHandle user) {