Fix a bug where non-VPN networks would update VPN uids.

Previously, non VPNs would not be created when updateVpnUids()
is called inside handleRegisterNetworkAgent. Because the network
is not created, netd would refuse to set the UIDs with an error.
Now that networks are created immediately with the
QUEUE_NETWORK_AGENT_EVENTS_IN_SYSTEM_SERVER flag,
the network is created and netd does set the UID for any
network as if they were a VPN. This results in the UID having
the wrong default network, which in turns prevents it from
accessing Internet.

Test: new test in this patch
Bug: 408717088
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:97e690169779f9790aa8d6026fca6bdc3d61e1b3)
Merged-In: If68ea7d60919c0c7e177480f6167196381e00f35
Change-Id: If68ea7d60919c0c7e177480f6167196381e00f35
2 files changed