Is there a way for an application to specify APN it uses for its mobile data connections? I can create and edit APNs and set the preferred APN. However setting the preferred APN looks to have a global effect, i.e. all apps will use that while my goal is "this app uses that APN while rest use that other APN". And with some APN configurations (e.g. no public Internet access) it seems OS will, in some (OS/OEM specific?) cases, revert to working APN (with public Internet access).
In case it makes any difference, I have carrier privileges available. And I've tried using various combinations of NetworkCapabilities.TRANSPORT_CELLULAR and NetworkCapabilities.NET_CAPABILITY_ZXY with NetworkRequest. These generally fail with the lack of android.permission.CONNECTIVITY_INTERNAL or android.permission.MAINLINE_NETWORK_STACK.