Add VPN name into the extra info of NetworkInfo
Add the extra info of a VPN network to provide helpful
debugging info.
The validation logs in the dumpsys of NetworkStack refer to
the extra info from NetworkInfo of the given network.
But the extra info in a VPN NetworkInfo is empty so the name
will be null. It's hard to tell the exact name information
from only dumpsys of NetworkStack.
Bug: 297790570
Test: atest FrameworksNetTests
Change-Id: I7cf5f30db9a9bbc0361e5dc6bf4d8f533e12f5c8
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index bfccd58..53fbe8f 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -1741,6 +1741,7 @@
.setBypassableVpn(bypassable)
.setVpnRequiresValidation(mConfig.requiresInternetValidation)
.setLocalRoutesExcludedForVpn(mConfig.excludeLocalRoutes)
+ .setLegacyExtraInfo("VPN:" + mPackage)
.build();
capsBuilder.setOwnerUid(mOwnerUID);