How to detect programatically if traffic is going through VPN without using intent to connect to VPNService. Is there some system call?
This works :
private boolean checkVPN() { ConnectivityManager cm = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getNetworkInfo(ConnectivityManager.TYPE_VPN).isConnectedOrConnecting(); }