It looks like a new API called
getConnectionOwnerUid will be added as an alternative to using /proc/net (
this is the corresponding review), which
won't be possible anymore on Android Q. I really hope this won't be revoked and that it will work properly and fast enough.
Edit: I have checked the Android source code and this solution should be more accurate and faster than the current NetGuard implementation, so this is really good news.
If you didn't already and are able to, please
star this issue to increase the chance this will be in Android Q.