My Android phone running wireguard VPN threats it as a metered connection and does not do anything it should do on Wi-Fi only

What I found is this discussion https://issuetracker.google.com/issues/114309459
I've looked thru the GitHub mirror code and found no evidance of setUnderlyingNetworks called in WireGuard client code. 

As seen in the issue tracker link above, it's needed in order to take advantage of this (https://developer.android.com/about/versions/pie/android-9.0-changes-all#network-capabilities-vpn) behavior change. As described in the issue tracker link, this prevents Pie devices from properly using unmetered WiFi networks.


--
Andrey Kupreychik <foxel@quickfox.ru>
http://foxel.quickfox.ru